repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
craftercms/profile | security-provider/src/main/java/org/craftercms/security/processors/impl/UrlAccessRestrictionCheckingProcessor.java | UrlAccessRestrictionCheckingProcessor.processRequest | public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception {
"""
Matches the request URL against the keys of the {@code restriction} map, which are ANT-style path patterns. If
a key matches, the value is interpreted as a Spring EL expression, the expression i... | java | public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws Exception {
Map<String, Expression> urlRestrictions = getUrlRestrictions();
if (MapUtils.isNotEmpty(urlRestrictions)) {
HttpServletRequest request = context.getRequest();
Stri... | [
"public",
"void",
"processRequest",
"(",
"RequestContext",
"context",
",",
"RequestSecurityProcessorChain",
"processorChain",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"Expression",
">",
"urlRestrictions",
"=",
"getUrlRestrictions",
"(",
")",
";",
... | Matches the request URL against the keys of the {@code restriction} map, which are ANT-style path patterns. If
a key matches, the value is interpreted as a Spring EL expression, the expression is executed, and if it returns
true, the processor chain is continued, if not an {@link AccessDeniedException} is thrown.
@par... | [
"Matches",
"the",
"request",
"URL",
"against",
"the",
"keys",
"of",
"the",
"{",
"@code",
"restriction",
"}",
"map",
"which",
"are",
"ANT",
"-",
"style",
"path",
"patterns",
".",
"If",
"a",
"key",
"matches",
"the",
"value",
"is",
"interpreted",
"as",
"a",... | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/processors/impl/UrlAccessRestrictionCheckingProcessor.java#L118-L149 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Collectors.java | Collectors.toMap | @NotNull
public static <T, K, V, M extends Map<K, V>> Collector<T, ?, M> toMap(
@NotNull final Function<? super T, ? extends K> keyMapper,
@NotNull final Function<? super T, ? extends V> valueMapper,
@NotNull final BinaryOperator<V> mergeFunction,
@NotNull final Suppl... | java | @NotNull
public static <T, K, V, M extends Map<K, V>> Collector<T, ?, M> toMap(
@NotNull final Function<? super T, ? extends K> keyMapper,
@NotNull final Function<? super T, ? extends V> valueMapper,
@NotNull final BinaryOperator<V> mergeFunction,
@NotNull final Suppl... | [
"@",
"NotNull",
"public",
"static",
"<",
"T",
",",
"K",
",",
"V",
",",
"M",
"extends",
"Map",
"<",
"K",
",",
"V",
">",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"M",
">",
"toMap",
"(",
"@",
"NotNull",
"final",
"Function",
"<",
"?",
"super",
... | Returns a {@code Collector} that fills new {@code Map} with input elements.
If the mapped keys contain duplicates, the value mapping function is applied
to each equal element, and the results are merged using the provided merging function.
@param <T> the type of the input elements
@param <K> the result type of key ma... | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"that",
"fills",
"new",
"{",
"@code",
"Map",
"}",
"with",
"input",
"elements",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Collectors.java#L321-L340 |
threerings/nenya | core/src/main/java/com/threerings/media/MediaOverlay.java | MediaOverlay.propagateDirtyRegions | public void propagateDirtyRegions (ActiveRepaintManager repmgr, JRootPane root) {
"""
Called by the {@link FrameManager} to propagate our dirty regions to the active repaint
manager so that it can repaint the underlying components just prior to our painting our
media. This will be followed by a call to {@link #p... | java | public void propagateDirtyRegions (ActiveRepaintManager repmgr, JRootPane root)
{
if (_metamgr.needsPaint()) {
// tell the repaint manager about our raw (unmerged) dirty regions so that it can dirty
// only components that are actually impacted
List<Rectangle> dlist = _me... | [
"public",
"void",
"propagateDirtyRegions",
"(",
"ActiveRepaintManager",
"repmgr",
",",
"JRootPane",
"root",
")",
"{",
"if",
"(",
"_metamgr",
".",
"needsPaint",
"(",
")",
")",
"{",
"// tell the repaint manager about our raw (unmerged) dirty regions so that it can dirty",
"//... | Called by the {@link FrameManager} to propagate our dirty regions to the active repaint
manager so that it can repaint the underlying components just prior to our painting our
media. This will be followed by a call to {@link #paint} after the components have been
repainted. | [
"Called",
"by",
"the",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaOverlay.java#L145-L157 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerKeyIndex.java | ContainerKeyIndex.notifyIndexOffsetChanged | void notifyIndexOffsetChanged(long segmentId, long indexOffset) {
"""
Notifies this ContainerKeyIndex instance that the {@link TableAttributes#INDEX_OFFSET} attribute value for the
given Segment has been changed.
@param segmentId The Id of the Segment whose Index Offset has changed.
@param indexOffset The n... | java | void notifyIndexOffsetChanged(long segmentId, long indexOffset) {
this.cache.updateSegmentIndexOffset(segmentId, indexOffset);
this.recoveryTracker.updateSegmentIndexOffset(segmentId, indexOffset);
} | [
"void",
"notifyIndexOffsetChanged",
"(",
"long",
"segmentId",
",",
"long",
"indexOffset",
")",
"{",
"this",
".",
"cache",
".",
"updateSegmentIndexOffset",
"(",
"segmentId",
",",
"indexOffset",
")",
";",
"this",
".",
"recoveryTracker",
".",
"updateSegmentIndexOffset"... | Notifies this ContainerKeyIndex instance that the {@link TableAttributes#INDEX_OFFSET} attribute value for the
given Segment has been changed.
@param segmentId The Id of the Segment whose Index Offset has changed.
@param indexOffset The new value for the Index Offset. A negative value indicates this segment has been... | [
"Notifies",
"this",
"ContainerKeyIndex",
"instance",
"that",
"the",
"{",
"@link",
"TableAttributes#INDEX_OFFSET",
"}",
"attribute",
"value",
"for",
"the",
"given",
"Segment",
"has",
"been",
"changed",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerKeyIndex.java#L489-L492 |
aws/aws-sdk-java | aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/PlacementTemplate.java | PlacementTemplate.withDefaultAttributes | public PlacementTemplate withDefaultAttributes(java.util.Map<String, String> defaultAttributes) {
"""
<p>
The default attributes (key/value pairs) to be applied to all placements using this template.
</p>
@param defaultAttributes
The default attributes (key/value pairs) to be applied to all placements using ... | java | public PlacementTemplate withDefaultAttributes(java.util.Map<String, String> defaultAttributes) {
setDefaultAttributes(defaultAttributes);
return this;
} | [
"public",
"PlacementTemplate",
"withDefaultAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"defaultAttributes",
")",
"{",
"setDefaultAttributes",
"(",
"defaultAttributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The default attributes (key/value pairs) to be applied to all placements using this template.
</p>
@param defaultAttributes
The default attributes (key/value pairs) to be applied to all placements using this template.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"default",
"attributes",
"(",
"key",
"/",
"value",
"pairs",
")",
"to",
"be",
"applied",
"to",
"all",
"placements",
"using",
"this",
"template",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot1clickprojects/src/main/java/com/amazonaws/services/iot1clickprojects/model/PlacementTemplate.java#L79-L82 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java | WebDriverHelper.assertCookie | public void assertCookie(final String cookieName, final String cookieValue) {
"""
Verifies that the given cookie name has the given cookie value. This
method is also add logging info. Please not that the method will do a
JUNIT Assert causing the test to fail.
@param cookieName
the cookie name
@param cookieV... | java | public void assertCookie(final String cookieName, final String cookieValue) {
Set<Cookie> cookies = driver.manage().getCookies();
for (Cookie cookie : cookies) {
if (cookie.getName().equals(cookieName)
&& cookie.getValue().equals(cookieValue)) {
LOG.info("Cookie: " + cookieName + " was found with value... | [
"public",
"void",
"assertCookie",
"(",
"final",
"String",
"cookieName",
",",
"final",
"String",
"cookieValue",
")",
"{",
"Set",
"<",
"Cookie",
">",
"cookies",
"=",
"driver",
".",
"manage",
"(",
")",
".",
"getCookies",
"(",
")",
";",
"for",
"(",
"Cookie",... | Verifies that the given cookie name has the given cookie value. This
method is also add logging info. Please not that the method will do a
JUNIT Assert causing the test to fail.
@param cookieName
the cookie name
@param cookieValue
the cookie value | [
"Verifies",
"that",
"the",
"given",
"cookie",
"name",
"has",
"the",
"given",
"cookie",
"value",
".",
"This",
"method",
"is",
"also",
"add",
"logging",
"info",
".",
"Please",
"not",
"that",
"the",
"method",
"will",
"do",
"a",
"JUNIT",
"Assert",
"causing",
... | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L376-L391 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/insights/BitmapAnalyser.java | BitmapAnalyser.analyse | public static BitmapStatistics analyse(RoaringBitmap r) {
"""
Analyze the internal representation of bitmap
@param r the bitmap
@return the statistics
"""
int acCount = 0;
int acCardinalitySum = 0;
int bcCount = 0;
int rcCount = 0;
ContainerPointer cp = r.getContainerPointer();
while ... | java | public static BitmapStatistics analyse(RoaringBitmap r) {
int acCount = 0;
int acCardinalitySum = 0;
int bcCount = 0;
int rcCount = 0;
ContainerPointer cp = r.getContainerPointer();
while (cp.getContainer() != null) {
if (cp.isBitmapContainer()) {
bcCount += 1;
} else if (cp.... | [
"public",
"static",
"BitmapStatistics",
"analyse",
"(",
"RoaringBitmap",
"r",
")",
"{",
"int",
"acCount",
"=",
"0",
";",
"int",
"acCardinalitySum",
"=",
"0",
";",
"int",
"bcCount",
"=",
"0",
";",
"int",
"rcCount",
"=",
"0",
";",
"ContainerPointer",
"cp",
... | Analyze the internal representation of bitmap
@param r the bitmap
@return the statistics | [
"Analyze",
"the",
"internal",
"representation",
"of",
"bitmap"
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/insights/BitmapAnalyser.java#L15-L35 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Maybe.java | Maybe.subscribeOn | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Maybe<T> subscribeOn(Scheduler scheduler) {
"""
Asynchronously subscribes subscribers to this Maybe on the specified {@link Scheduler}.
<p>
<img width="640" height="752" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-o... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Maybe<T> subscribeOn(Scheduler scheduler) {
ObjectHelper.requireNonNull(scheduler, "scheduler is null");
return RxJavaPlugins.onAssembly(new MaybeSubscribeOn<T>(this, scheduler));
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"CUSTOM",
")",
"public",
"final",
"Maybe",
"<",
"T",
">",
"subscribeOn",
"(",
"Scheduler",
"scheduler",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"scheduler",
",",
"\"sch... | Asynchronously subscribes subscribers to this Maybe on the specified {@link Scheduler}.
<p>
<img width="640" height="752" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.subscribeOn.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>you specify which {@link Scheduler} this operator will use.</... | [
"Asynchronously",
"subscribes",
"subscribers",
"to",
"this",
"Maybe",
"on",
"the",
"specified",
"{",
"@link",
"Scheduler",
"}",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"752",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Maybe.java#L4191-L4196 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/platform/ApplicationUrl.java | ApplicationUrl.deletePackageFileUrl | public static MozuUrl deletePackageFileUrl(String applicationKey, String filepath) {
"""
Get Resource Url for DeletePackageFile
@param applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Applicat... | java | public static MozuUrl deletePackageFileUrl(String applicationKey, String filepath)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/developer/packages/{applicationKey}/files/{filepath}");
formatter.formatUrl("applicationKey", applicationKey);
formatter.formatUrl("filepath", filepath);
return new... | [
"public",
"static",
"MozuUrl",
"deletePackageFileUrl",
"(",
"String",
"applicationKey",
",",
"String",
"filepath",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/developer/packages/{applicationKey}/files/{filepath}\"",
")",
";",
"fo... | Get Resource Url for DeletePackageFile
@param applicationKey The application key uniquely identifies the developer namespace, application ID, version, and package in Dev Center. The format is {Dev Account namespace}.{Application ID}.{Application Version}.{Package name}.
@param filepath Represents the file name and loca... | [
"Get",
"Resource",
"Url",
"for",
"DeletePackageFile"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/platform/ApplicationUrl.java#L112-L118 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.invoke | public static <T> T invoke(String classNameWithMethodName, Object[] args) {
"""
执行方法<br>
可执行Private方法,也可执行static方法<br>
执行非static方法时,必须满足对象有默认构造方法<br>
非单例模式,如果是非静态方法,每次创建一个新对象
@param <T> 对象类型
@param classNameWithMethodName 类名和方法名表达式,类名与方法名用<code>.</code>或<code>#</code>连接 例如:com.xiaoleilu.hutool.StrUtil.isEmp... | java | public static <T> T invoke(String classNameWithMethodName, Object[] args) {
return invoke(classNameWithMethodName, false, args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"invoke",
"(",
"String",
"classNameWithMethodName",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"return",
"invoke",
"(",
"classNameWithMethodName",
",",
"false",
",",
"args",
")",
";",
"}"
] | 执行方法<br>
可执行Private方法,也可执行static方法<br>
执行非static方法时,必须满足对象有默认构造方法<br>
非单例模式,如果是非静态方法,每次创建一个新对象
@param <T> 对象类型
@param classNameWithMethodName 类名和方法名表达式,类名与方法名用<code>.</code>或<code>#</code>连接 例如:com.xiaoleilu.hutool.StrUtil.isEmpty 或 com.xiaoleilu.hutool.StrUtil#isEmpty
@param args 参数,必须严格对应指定方法的参数类型和数量
@return 返回结果 | [
"执行方法<br",
">",
"可执行Private方法,也可执行static方法<br",
">",
"执行非static方法时,必须满足对象有默认构造方法<br",
">",
"非单例模式,如果是非静态方法,每次创建一个新对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L619-L621 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/MiniSat.java | MiniSat.createAssignment | private Assignment createAssignment(final LNGBooleanVector vec, final LNGIntVector relevantIndices) {
"""
Creates an assignment from a Boolean vector of the solver.
@param vec the vector of the solver
@param relevantIndices the solver's indices of the relevant variables for the model. If {@code null... | java | private Assignment createAssignment(final LNGBooleanVector vec, final LNGIntVector relevantIndices) {
final Assignment model = new Assignment();
if (relevantIndices == null) {
for (int i = 0; i < vec.size(); i++) {
model.addLiteral(this.f.literal(this.solver.nameForIdx(i), vec.get(i)));
}
... | [
"private",
"Assignment",
"createAssignment",
"(",
"final",
"LNGBooleanVector",
"vec",
",",
"final",
"LNGIntVector",
"relevantIndices",
")",
"{",
"final",
"Assignment",
"model",
"=",
"new",
"Assignment",
"(",
")",
";",
"if",
"(",
"relevantIndices",
"==",
"null",
... | Creates an assignment from a Boolean vector of the solver.
@param vec the vector of the solver
@param relevantIndices the solver's indices of the relevant variables for the model. If {@code null}, all
variables are relevant.
@return the assignment | [
"Creates",
"an",
"assignment",
"from",
"a",
"Boolean",
"vector",
"of",
"the",
"solver",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/MiniSat.java#L489-L504 |
inversoft/restify | src/main/java/com/inversoft/net/ssl/SSLTools.java | SSLTools.signWithRSA | public static String signWithRSA(String string, String keyString) throws GeneralSecurityException, IOException {
"""
Sign the provided string with the private key and the provided signature. The provided private key string is expected to be in one of
the two formats: PKCS#1 or PKCS#8.
@param string The stri... | java | public static String signWithRSA(String string, String keyString) throws GeneralSecurityException, IOException {
try {
RSAPrivateKey privateKey;
// If PKCS#1
if (keyString.contains(PKCS_1_KEY_START)) {
byte[] bytes = parseDERFromPEM(keyString, PKCS_1_KEY_START, PKCS_1_KEY_END);
pri... | [
"public",
"static",
"String",
"signWithRSA",
"(",
"String",
"string",
",",
"String",
"keyString",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"try",
"{",
"RSAPrivateKey",
"privateKey",
";",
"// If PKCS#1",
"if",
"(",
"keyString",
".",
"cont... | Sign the provided string with the private key and the provided signature. The provided private key string is expected to be in one of
the two formats: PKCS#1 or PKCS#8.
@param string The string to sign.
@param keyString The private to use when signing the string.
@return the signed string. | [
"Sign",
"the",
"provided",
"string",
"with",
"the",
"private",
"key",
"and",
"the",
"provided",
"signature",
".",
"The",
"provided",
"private",
"key",
"string",
"is",
"expected",
"to",
"be",
"in",
"one",
"of",
"the",
"two",
"formats",
":",
"PKCS#1",
"or",
... | train | https://github.com/inversoft/restify/blob/f2426d9082e00a9d958af28f78ccda61802c6700/src/main/java/com/inversoft/net/ssl/SSLTools.java#L181-L203 |
Netflix/ribbon | ribbon-archaius/src/main/java/com/netflix/client/config/DefaultClientConfigImpl.java | DefaultClientConfigImpl.putDefaultIntegerProperty | protected void putDefaultIntegerProperty(IClientConfigKey propName, Integer defaultValue) {
"""
passed as argument is used to put into the properties member variable
"""
Integer value = ConfigurationManager.getConfigInstance().getInteger(
getDefaultPropName(propName), defaultValue);
... | java | protected void putDefaultIntegerProperty(IClientConfigKey propName, Integer defaultValue) {
Integer value = ConfigurationManager.getConfigInstance().getInteger(
getDefaultPropName(propName), defaultValue);
setPropertyInternal(propName, value);
} | [
"protected",
"void",
"putDefaultIntegerProperty",
"(",
"IClientConfigKey",
"propName",
",",
"Integer",
"defaultValue",
")",
"{",
"Integer",
"value",
"=",
"ConfigurationManager",
".",
"getConfigInstance",
"(",
")",
".",
"getInteger",
"(",
"getDefaultPropName",
"(",
"pr... | passed as argument is used to put into the properties member variable | [
"passed",
"as",
"argument",
"is",
"used",
"to",
"put",
"into",
"the",
"properties",
"member",
"variable"
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-archaius/src/main/java/com/netflix/client/config/DefaultClientConfigImpl.java#L560-L564 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/asm/ClassReader.java | ClassReader.readConst | public Object readConst(final int item, final char[] buf) {
"""
Reads a numeric or string constant pool item in {@link #b b}. <i>This
method is intended for {@link Attribute} sub classes, and is normally not
needed by class generators or adapters.</i>
@param item
the index of a constant pool item.
@param bu... | java | public Object readConst(final int item, final char[] buf) {
int index = items[item];
switch (b[index - 1]) {
case ClassWriter.INT:
return readInt(index);
case ClassWriter.FLOAT:
return Float.intBitsToFloat(readInt(index));
case ClassWriter.LONG:
... | [
"public",
"Object",
"readConst",
"(",
"final",
"int",
"item",
",",
"final",
"char",
"[",
"]",
"buf",
")",
"{",
"int",
"index",
"=",
"items",
"[",
"item",
"]",
";",
"switch",
"(",
"b",
"[",
"index",
"-",
"1",
"]",
")",
"{",
"case",
"ClassWriter",
... | Reads a numeric or string constant pool item in {@link #b b}. <i>This
method is intended for {@link Attribute} sub classes, and is normally not
needed by class generators or adapters.</i>
@param item
the index of a constant pool item.
@param buf
buffer to be used to read the item. This buffer must be
sufficiently larg... | [
"Reads",
"a",
"numeric",
"or",
"string",
"constant",
"pool",
"item",
"in",
"{",
"@link",
"#b",
"b",
"}",
".",
"<i",
">",
"This",
"method",
"is",
"intended",
"for",
"{",
"@link",
"Attribute",
"}",
"sub",
"classes",
"and",
"is",
"normally",
"not",
"neede... | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/asm/ClassReader.java#L2479-L2506 |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java | LocalClientFactory.createLocalClient | public JestClient createLocalClient(String className, String fieldName, String indexName, String defaultIndexName) {
"""
Creates a cache by looking it up in a static field. Typically used for
testing.
@param className the class name
@param fieldName the field name
@param indexName the name of the ES index
@p... | java | public JestClient createLocalClient(String className, String fieldName, String indexName, String defaultIndexName) {
String clientKey = "local:" + className + '/' + fieldName; //$NON-NLS-1$
synchronized (clients) {
if (clients.containsKey(clientKey)) {
return clients.get(clie... | [
"public",
"JestClient",
"createLocalClient",
"(",
"String",
"className",
",",
"String",
"fieldName",
",",
"String",
"indexName",
",",
"String",
"defaultIndexName",
")",
"{",
"String",
"clientKey",
"=",
"\"local:\"",
"+",
"className",
"+",
"'",
"'",
"+",
"fieldNa... | Creates a cache by looking it up in a static field. Typically used for
testing.
@param className the class name
@param fieldName the field name
@param indexName the name of the ES index
@param defaultIndexName the name of the default ES index
@return the ES client | [
"Creates",
"a",
"cache",
"by",
"looking",
"it",
"up",
"in",
"a",
"static",
"field",
".",
"Typically",
"used",
"for",
"testing",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/LocalClientFactory.java#L74-L93 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/log/LogHelper.java | LogHelper.isEnabled | public static boolean isEnabled (@Nonnull final Logger aLogger, @Nonnull final IHasErrorLevel aErrorLevelProvider) {
"""
Check if logging is enabled for the passed logger based on the error level
provider by the passed object
@param aLogger
The logger. May not be <code>null</code>.
@param aErrorLevelProvider... | java | public static boolean isEnabled (@Nonnull final Logger aLogger, @Nonnull final IHasErrorLevel aErrorLevelProvider)
{
return isEnabled (aLogger, aErrorLevelProvider.getErrorLevel ());
} | [
"public",
"static",
"boolean",
"isEnabled",
"(",
"@",
"Nonnull",
"final",
"Logger",
"aLogger",
",",
"@",
"Nonnull",
"final",
"IHasErrorLevel",
"aErrorLevelProvider",
")",
"{",
"return",
"isEnabled",
"(",
"aLogger",
",",
"aErrorLevelProvider",
".",
"getErrorLevel",
... | Check if logging is enabled for the passed logger based on the error level
provider by the passed object
@param aLogger
The logger. May not be <code>null</code>.
@param aErrorLevelProvider
The error level provider. May not be <code>null</code>.
@return <code>true</code> if the respective log level is allowed,
<code>fa... | [
"Check",
"if",
"logging",
"is",
"enabled",
"for",
"the",
"passed",
"logger",
"based",
"on",
"the",
"error",
"level",
"provider",
"by",
"the",
"passed",
"object"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/log/LogHelper.java#L135-L138 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_configurations_obfuscatedEmails_GET | public ArrayList<OvhObfuscatedEmails> serviceName_configurations_obfuscatedEmails_GET(String serviceName) throws IOException {
"""
Retrieve obfuscated emails configuration
REST: GET /domain/{serviceName}/configurations/obfuscatedEmails
@param serviceName [required] The internal name of your domain
"""
St... | java | public ArrayList<OvhObfuscatedEmails> serviceName_configurations_obfuscatedEmails_GET(String serviceName) throws IOException {
String qPath = "/domain/{serviceName}/configurations/obfuscatedEmails";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return conver... | [
"public",
"ArrayList",
"<",
"OvhObfuscatedEmails",
">",
"serviceName_configurations_obfuscatedEmails_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/configurations/obfuscatedEmails\"",
";",
"StringBuilder",
... | Retrieve obfuscated emails configuration
REST: GET /domain/{serviceName}/configurations/obfuscatedEmails
@param serviceName [required] The internal name of your domain | [
"Retrieve",
"obfuscated",
"emails",
"configuration"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1576-L1581 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/base64/Base64Slow.java | Base64Slow.decodeToString | public static String decodeToString(InputStream in, String enc) throws IOException {
"""
Decode Base64 encoded data from the InputStream to a String. Characters that are not part of
the Base64 alphabet are ignored in the input.
@param in Stream from which to read data that needs to be decoded.
@param enc Char... | java | public static String decodeToString(InputStream in, String enc) throws IOException {
return new String(decodeToBytes(in), enc);
} | [
"public",
"static",
"String",
"decodeToString",
"(",
"InputStream",
"in",
",",
"String",
"enc",
")",
"throws",
"IOException",
"{",
"return",
"new",
"String",
"(",
"decodeToBytes",
"(",
"in",
")",
",",
"enc",
")",
";",
"}"
] | Decode Base64 encoded data from the InputStream to a String. Characters that are not part of
the Base64 alphabet are ignored in the input.
@param in Stream from which to read data that needs to be decoded.
@param enc Character encoding to use when converting bytes to characters.
@return decoded data.
@throws IOExcepti... | [
"Decode",
"Base64",
"encoded",
"data",
"from",
"the",
"InputStream",
"to",
"a",
"String",
".",
"Characters",
"that",
"are",
"not",
"part",
"of",
"the",
"Base64",
"alphabet",
"are",
"ignored",
"in",
"the",
"input",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/base64/Base64Slow.java#L744-L746 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/policy/RawDatasetRetentionPolicy.java | RawDatasetRetentionPolicy.listQualifiedRawFileSystemDatasetVersions | protected Collection<FileSystemDatasetVersion> listQualifiedRawFileSystemDatasetVersions(Collection<FileSystemDatasetVersion> allVersions) {
"""
A raw dataset version is qualified to be deleted, iff the corresponding refined paths exist, and the latest
mod time of all files is in the raw dataset is earlier than t... | java | protected Collection<FileSystemDatasetVersion> listQualifiedRawFileSystemDatasetVersions(Collection<FileSystemDatasetVersion> allVersions) {
return Lists.newArrayList(Collections2.filter(allVersions, new Predicate<FileSystemDatasetVersion>() {
@Override
public boolean apply(FileSystemDatasetVersion vers... | [
"protected",
"Collection",
"<",
"FileSystemDatasetVersion",
">",
"listQualifiedRawFileSystemDatasetVersions",
"(",
"Collection",
"<",
"FileSystemDatasetVersion",
">",
"allVersions",
")",
"{",
"return",
"Lists",
".",
"newArrayList",
"(",
"Collections2",
".",
"filter",
"(",... | A raw dataset version is qualified to be deleted, iff the corresponding refined paths exist, and the latest
mod time of all files is in the raw dataset is earlier than the latest mod time of all files in the refined paths. | [
"A",
"raw",
"dataset",
"version",
"is",
"qualified",
"to",
"be",
"deleted",
"iff",
"the",
"corresponding",
"refined",
"paths",
"exist",
"and",
"the",
"latest",
"mod",
"time",
"of",
"all",
"files",
"is",
"in",
"the",
"raw",
"dataset",
"is",
"earlier",
"than... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/policy/RawDatasetRetentionPolicy.java#L73-L88 |
baratine/baratine | framework/src/main/java/com/caucho/v5/config/expr/ExprCfgParserImpl.java | ExprCfgParserImpl.parseCondExpr | private ExprCfg parseCondExpr(ExprCfg test) {
"""
/*
private Expr parseLambdaExpr(Expr left)
{
LambdaParamsExpr params = null;
if (left instanceof LambdaParamsExpr) {
params = (LambdaParamsExpr) left;
}
else {
params = new LambdaParamsExpr(left);
}
HashMap<String,Expr> oldLambdaVars = _lambdaVars;
_la... | java | private ExprCfg parseCondExpr(ExprCfg test)
{
ExprCfg left = parseExpr();
ExprToken token = scanToken();
if (token != ExprToken.COLON) {
throw error(L.l("Expected ':' at {0}. Conditional syntax is 'expr ? expr : expr'.", token));
}
ExprCfg right = parseTerm();
while (true) {... | [
"private",
"ExprCfg",
"parseCondExpr",
"(",
"ExprCfg",
"test",
")",
"{",
"ExprCfg",
"left",
"=",
"parseExpr",
"(",
")",
";",
"ExprToken",
"token",
"=",
"scanToken",
"(",
")",
";",
"if",
"(",
"token",
"!=",
"ExprToken",
".",
"COLON",
")",
"{",
"throw",
... | /*
private Expr parseLambdaExpr(Expr left)
{
LambdaParamsExpr params = null;
if (left instanceof LambdaParamsExpr) {
params = (LambdaParamsExpr) left;
}
else {
params = new LambdaParamsExpr(left);
}
HashMap<String,Expr> oldLambdaVars = _lambdaVars;
_lambdaVars = new HashMap<String,Expr>();
if (oldLambdaVars != null) ... | [
"/",
"*",
"private",
"Expr",
"parseLambdaExpr",
"(",
"Expr",
"left",
")",
"{",
"LambdaParamsExpr",
"params",
"=",
"null",
";",
"if",
"(",
"left",
"instanceof",
"LambdaParamsExpr",
")",
"{",
"params",
"=",
"(",
"LambdaParamsExpr",
")",
"left",
";",
"}",
"el... | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/config/expr/ExprCfgParserImpl.java#L437-L486 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/StringUtilities.java | StringUtilities.getWildcardMatcher | public static Matcher getWildcardMatcher(String str, String expr) {
"""
Returns <CODE>true</CODE> if the given string matches the given regular expression.
@param str The string against which the expression is to be matched
@param expr The regular expression to match with the input string
@return An object givi... | java | public static Matcher getWildcardMatcher(String str, String expr)
{
return getWildcardMatcher(str, expr, false);
} | [
"public",
"static",
"Matcher",
"getWildcardMatcher",
"(",
"String",
"str",
",",
"String",
"expr",
")",
"{",
"return",
"getWildcardMatcher",
"(",
"str",
",",
"expr",
",",
"false",
")",
";",
"}"
] | Returns <CODE>true</CODE> if the given string matches the given regular expression.
@param str The string against which the expression is to be matched
@param expr The regular expression to match with the input string
@return An object giving the results of the search (or null if no match found) | [
"Returns",
"<CODE",
">",
"true<",
"/",
"CODE",
">",
"if",
"the",
"given",
"string",
"matches",
"the",
"given",
"regular",
"expression",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/StringUtilities.java#L334-L337 |
GoogleCloudPlatform/bigdata-interop | util/src/main/java/com/google/cloud/hadoop/util/CredentialFactory.java | CredentialFactory.getApplicationDefaultCredentials | public Credential getApplicationDefaultCredentials(List<String> scopes, HttpTransport transport)
throws IOException, GeneralSecurityException {
"""
Get Google Application Default Credentials as described in <a
href="https://developers.google.com/identity/protocols/application-default-credentials#callingjava... | java | public Credential getApplicationDefaultCredentials(List<String> scopes, HttpTransport transport)
throws IOException, GeneralSecurityException {
logger.atFine().log("getApplicationDefaultCredential(%s)", scopes);
return GoogleCredentialWithRetry.fromGoogleCredential(
GoogleCredential.getApplication... | [
"public",
"Credential",
"getApplicationDefaultCredentials",
"(",
"List",
"<",
"String",
">",
"scopes",
",",
"HttpTransport",
"transport",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"logger",
".",
"atFine",
"(",
")",
".",
"log",
"(",
"\"get... | Get Google Application Default Credentials as described in <a
href="https://developers.google.com/identity/protocols/application-default-credentials#callingjava"
>Google Application Default Credentials</a>
@param scopes The OAuth scopes that the credential should be valid for. | [
"Get",
"Google",
"Application",
"Default",
"Credentials",
"as",
"described",
"in",
"<a",
"href",
"=",
"https",
":",
"//",
"developers",
".",
"google",
".",
"com",
"/",
"identity",
"/",
"protocols",
"/",
"application",
"-",
"default",
"-",
"credentials#callingj... | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/util/src/main/java/com/google/cloud/hadoop/util/CredentialFactory.java#L377-L382 |
spacecowboy/NoNonsense-FilePicker | library/src/main/java/com/nononsenseapps/filepicker/FilePickerFragment.java | FilePickerFragment.onNewFolder | @Override
public void onNewFolder(@NonNull final String name) {
"""
Name is validated to be non-null, non-empty and not containing any
slashes.
@param name The name of the folder the user wishes to create.
"""
File folder = new File(mCurrentPath, name);
if (folder.mkdir()) {
... | java | @Override
public void onNewFolder(@NonNull final String name) {
File folder = new File(mCurrentPath, name);
if (folder.mkdir()) {
refresh(folder);
} else {
Toast.makeText(getActivity(), R.string.nnf_create_folder_error,
Toast.LENGTH_SHORT).show();... | [
"@",
"Override",
"public",
"void",
"onNewFolder",
"(",
"@",
"NonNull",
"final",
"String",
"name",
")",
"{",
"File",
"folder",
"=",
"new",
"File",
"(",
"mCurrentPath",
",",
"name",
")",
";",
"if",
"(",
"folder",
".",
"mkdir",
"(",
")",
")",
"{",
"refr... | Name is validated to be non-null, non-empty and not containing any
slashes.
@param name The name of the folder the user wishes to create. | [
"Name",
"is",
"validated",
"to",
"be",
"non",
"-",
"null",
"non",
"-",
"empty",
"and",
"not",
"containing",
"any",
"slashes",
"."
] | train | https://github.com/spacecowboy/NoNonsense-FilePicker/blob/396ef7fa5e87791170791f9d94c78f6e42a7679a/library/src/main/java/com/nononsenseapps/filepicker/FilePickerFragment.java#L305-L315 |
dmak/jaxb-xew-plugin | src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java | CommonUtils.isListedAsParametrisation | public static boolean isListedAsParametrisation(JClass classToCheck, JType type) {
"""
Returns <code>true</code> of the given <code>type</code> is {@link JClass} and contains <code>classToCheck</code>
in the list of parametrisations.
"""
return type instanceof JClass && ((JClass) type).getTypeParameters().c... | java | public static boolean isListedAsParametrisation(JClass classToCheck, JType type) {
return type instanceof JClass && ((JClass) type).getTypeParameters().contains(classToCheck);
} | [
"public",
"static",
"boolean",
"isListedAsParametrisation",
"(",
"JClass",
"classToCheck",
",",
"JType",
"type",
")",
"{",
"return",
"type",
"instanceof",
"JClass",
"&&",
"(",
"(",
"JClass",
")",
"type",
")",
".",
"getTypeParameters",
"(",
")",
".",
"contains"... | Returns <code>true</code> of the given <code>type</code> is {@link JClass} and contains <code>classToCheck</code>
in the list of parametrisations. | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"of",
"the",
"given",
"<code",
">",
"type<",
"/",
"code",
">",
"is",
"{"
] | train | https://github.com/dmak/jaxb-xew-plugin/blob/d564d6bf8e50c46b056cdb4b46d1d4bee4adfbe3/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java#L49-L51 |
LevelFourAB/commons | commons-config/src/main/java/se/l4/commons/config/ConfigKey.java | ConfigKey.asObject | @NonNull
public <T> T asObject(String subPath, Class<T> type) {
"""
Get the value of a sub path to this key.
@param subPath
@param type
@return
"""
return config.asObject(key + '.' + subPath, type);
} | java | @NonNull
public <T> T asObject(String subPath, Class<T> type)
{
return config.asObject(key + '.' + subPath, type);
} | [
"@",
"NonNull",
"public",
"<",
"T",
">",
"T",
"asObject",
"(",
"String",
"subPath",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"config",
".",
"asObject",
"(",
"key",
"+",
"'",
"'",
"+",
"subPath",
",",
"type",
")",
";",
"}"
] | Get the value of a sub path to this key.
@param subPath
@param type
@return | [
"Get",
"the",
"value",
"of",
"a",
"sub",
"path",
"to",
"this",
"key",
"."
] | train | https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-config/src/main/java/se/l4/commons/config/ConfigKey.java#L65-L69 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Parameters.java | Parameters.setBoolean | @NonNull
public Parameters setBoolean(@NonNull String name, boolean value) {
"""
Set a boolean value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The boolean value.... | java | @NonNull
public Parameters setBoolean(@NonNull String name, boolean value) {
return setValue(name, value);
} | [
"@",
"NonNull",
"public",
"Parameters",
"setBoolean",
"(",
"@",
"NonNull",
"String",
"name",
",",
"boolean",
"value",
")",
"{",
"return",
"setValue",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Set a boolean value to the query parameter referenced by the given name. A query parameter
is defined by using the Expression's parameter(String name) function.
@param name The parameter name.
@param value The boolean value.
@return The self object. | [
"Set",
"a",
"boolean",
"value",
"to",
"the",
"query",
"parameter",
"referenced",
"by",
"the",
"given",
"name",
".",
"A",
"query",
"parameter",
"is",
"defined",
"by",
"using",
"the",
"Expression",
"s",
"parameter",
"(",
"String",
"name",
")",
"function",
".... | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Parameters.java#L157-L160 |
andrehertwig/admintool | admin-tools-core/src/main/java/de/chandre/admintool/core/controller/AbstractAdminController.java | AbstractAdminController.resolveLocale | protected void resolveLocale(String language, HttpServletRequest request, HttpServletResponse response) {
"""
manually resolve of locale ... to request. useful for path variables
@param language locale representation as string
@param request
@param response
"""
final LocaleEditor localeEditor = new Loca... | java | protected void resolveLocale(String language, HttpServletRequest request, HttpServletResponse response){
final LocaleEditor localeEditor = new LocaleEditor();
localeEditor.setAsText(language);
resolveLocale((Locale) localeEditor.getValue(), request, response);
} | [
"protected",
"void",
"resolveLocale",
"(",
"String",
"language",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"final",
"LocaleEditor",
"localeEditor",
"=",
"new",
"LocaleEditor",
"(",
")",
";",
"localeEditor",
".",
"setAsTe... | manually resolve of locale ... to request. useful for path variables
@param language locale representation as string
@param request
@param response | [
"manually",
"resolve",
"of",
"locale",
"...",
"to",
"request",
".",
"useful",
"for",
"path",
"variables"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-core/src/main/java/de/chandre/admintool/core/controller/AbstractAdminController.java#L136-L140 |
fuinorg/units4j | src/main/java/org/fuin/units4j/analyzer/MethodCallAnalyzer.java | MethodCallAnalyzer.findCallingMethodsInDir | public final void findCallingMethodsInDir(final File dir, final FileFilter filter) {
"""
Locate method calls in classes of a directory.
@param dir
Directory to search (including sub directories).
@param filter
File filter or NULL (process all '*.class' files).
"""
final FileProcessor fileProce... | java | public final void findCallingMethodsInDir(final File dir, final FileFilter filter) {
final FileProcessor fileProcessor = new FileProcessor(new FileHandler() {
@Override
public final FileHandlerResult handleFile(final File file) {
if (file.isDirectory()) {
... | [
"public",
"final",
"void",
"findCallingMethodsInDir",
"(",
"final",
"File",
"dir",
",",
"final",
"FileFilter",
"filter",
")",
"{",
"final",
"FileProcessor",
"fileProcessor",
"=",
"new",
"FileProcessor",
"(",
"new",
"FileHandler",
"(",
")",
"{",
"@",
"Override",
... | Locate method calls in classes of a directory.
@param dir
Directory to search (including sub directories).
@param filter
File filter or NULL (process all '*.class' files). | [
"Locate",
"method",
"calls",
"in",
"classes",
"of",
"a",
"directory",
"."
] | train | https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/analyzer/MethodCallAnalyzer.java#L137-L153 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/CmsCroppingParamBean.java | CmsCroppingParamBean.getRestrictedSizeParam | public CmsCroppingParamBean getRestrictedSizeParam(int maxHeight, int maxWidth) {
"""
Returns a cropping bean with a restricted maximum target size.<p>
@param maxHeight the max height
@param maxWidth the max width
@return the cropping bean
"""
CmsCroppingParamBean result = new CmsCroppingParamB... | java | public CmsCroppingParamBean getRestrictedSizeParam(int maxHeight, int maxWidth) {
CmsCroppingParamBean result = new CmsCroppingParamBean(this);
if ((getTargetHeight() <= maxHeight) && (getTargetWidth() <= maxWidth)) {
if ((getTargetHeight() == I_CmsFormatRestriction.DIMENSION_NOT_SET) && (g... | [
"public",
"CmsCroppingParamBean",
"getRestrictedSizeParam",
"(",
"int",
"maxHeight",
",",
"int",
"maxWidth",
")",
"{",
"CmsCroppingParamBean",
"result",
"=",
"new",
"CmsCroppingParamBean",
"(",
"this",
")",
";",
"if",
"(",
"(",
"getTargetHeight",
"(",
")",
"<=",
... | Returns a cropping bean with a restricted maximum target size.<p>
@param maxHeight the max height
@param maxWidth the max width
@return the cropping bean | [
"Returns",
"a",
"cropping",
"bean",
"with",
"a",
"restricted",
"maximum",
"target",
"size",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/CmsCroppingParamBean.java#L330-L353 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/StreamUtil.java | StreamUtil.getOutputStreamWriter | public static Writer getOutputStreamWriter(OutputStream out) {
"""
Returns a writer for the specified output stream, using UTF-8 encoding.
@param out the output stream to wrap
@return a writer for this output stream
"""
try {
return new OutputStreamWriter(out, "UTF-8");
}
catch (Unsupported... | java | public static Writer getOutputStreamWriter(OutputStream out) {
try {
return new OutputStreamWriter(out, "UTF-8");
}
catch (UnsupportedEncodingException ex) {
throw new RuntimeException(ex); // shouldn't happen since UTF-8 is supported by all JVMs per spec
}
} | [
"public",
"static",
"Writer",
"getOutputStreamWriter",
"(",
"OutputStream",
"out",
")",
"{",
"try",
"{",
"return",
"new",
"OutputStreamWriter",
"(",
"out",
",",
"\"UTF-8\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"ex",
")",
"{",
"throw",
... | Returns a writer for the specified output stream, using UTF-8 encoding.
@param out the output stream to wrap
@return a writer for this output stream | [
"Returns",
"a",
"writer",
"for",
"the",
"specified",
"output",
"stream",
"using",
"UTF",
"-",
"8",
"encoding",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/StreamUtil.java#L133-L140 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java | AbstractQueryProtocol.readResultSet | private void readResultSet(Buffer buffer, Results results) throws SQLException {
"""
Read ResultSet Packet.
@param buffer current buffer
@param results result object
@throws SQLException if sub-result connection fail
@see <a href="https://mariadb.com/kb/en/mariadb/resultset/">resultSet packets</a>
"""
... | java | private void readResultSet(Buffer buffer, Results results) throws SQLException {
long fieldCount = buffer.getLengthEncodedNumeric();
try {
//read columns information's
ColumnInformation[] ci = new ColumnInformation[(int) fieldCount];
for (int i = 0; i < fieldCount; i++) {
ci[i] = new... | [
"private",
"void",
"readResultSet",
"(",
"Buffer",
"buffer",
",",
"Results",
"results",
")",
"throws",
"SQLException",
"{",
"long",
"fieldCount",
"=",
"buffer",
".",
"getLengthEncodedNumeric",
"(",
")",
";",
"try",
"{",
"//read columns information's",
"ColumnInforma... | Read ResultSet Packet.
@param buffer current buffer
@param results result object
@throws SQLException if sub-result connection fail
@see <a href="https://mariadb.com/kb/en/mariadb/resultset/">resultSet packets</a> | [
"Read",
"ResultSet",
"Packet",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L1688-L1735 |
qubole/qds-sdk-java | src/main/java/com/qubole/qds/sdk/java/client/ResultLatch.java | ResultLatch.awaitResult | public ResultValue awaitResult(long maxWait, TimeUnit timeUnit) throws Exception {
"""
Await up to a maximum time for the result
@param maxWait max wait time
@param timeUnit time unit
@return the result
@throws Exception errors
"""
if (!await(maxWait, timeUnit))
{
throw new Ti... | java | public ResultValue awaitResult(long maxWait, TimeUnit timeUnit) throws Exception
{
if (!await(maxWait, timeUnit))
{
throw new TimeoutException();
}
return getResultValue();
} | [
"public",
"ResultValue",
"awaitResult",
"(",
"long",
"maxWait",
",",
"TimeUnit",
"timeUnit",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"await",
"(",
"maxWait",
",",
"timeUnit",
")",
")",
"{",
"throw",
"new",
"TimeoutException",
"(",
")",
";",
"}",
... | Await up to a maximum time for the result
@param maxWait max wait time
@param timeUnit time unit
@return the result
@throws Exception errors | [
"Await",
"up",
"to",
"a",
"maximum",
"time",
"for",
"the",
"result"
] | train | https://github.com/qubole/qds-sdk-java/blob/c652374075c7b72071f73db960f5f3a43f922afd/src/main/java/com/qubole/qds/sdk/java/client/ResultLatch.java#L205-L212 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/PrepareRequestInterceptor.java | PrepareRequestInterceptor.setupAcceptHeader | private void setupAcceptHeader(String action, Map<String, String> requestHeaders, Map<String, String> requestParameters) {
"""
Setup accept header depends from the semantic of the request
@param action
@param requestHeaders
"""
// validates whether to add headers for accept for serialization
... | java | private void setupAcceptHeader(String action, Map<String, String> requestHeaders, Map<String, String> requestParameters) {
// validates whether to add headers for accept for serialization
String serializeAcceptFormat = getSerializationResponseFormat();
if (StringUtils.hasText(serializeAcceptForm... | [
"private",
"void",
"setupAcceptHeader",
"(",
"String",
"action",
",",
"Map",
"<",
"String",
",",
"String",
">",
"requestHeaders",
",",
"Map",
"<",
"String",
",",
"String",
">",
"requestParameters",
")",
"{",
"// validates whether to add headers for accept for serializ... | Setup accept header depends from the semantic of the request
@param action
@param requestHeaders | [
"Setup",
"accept",
"header",
"depends",
"from",
"the",
"semantic",
"of",
"the",
"request"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/interceptors/PrepareRequestInterceptor.java#L173-L185 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/masterslave/MasterSlaveUtils.java | MasterSlaveUtils.findNodeByUri | static RedisNodeDescription findNodeByUri(Collection<RedisNodeDescription> nodes, RedisURI lookupUri) {
"""
Lookup a {@link RedisNodeDescription} by {@link RedisURI}.
@param nodes
@param lookupUri
@return the {@link RedisNodeDescription} or {@literal null}
"""
return findNodeByHostAndPort(nodes, l... | java | static RedisNodeDescription findNodeByUri(Collection<RedisNodeDescription> nodes, RedisURI lookupUri) {
return findNodeByHostAndPort(nodes, lookupUri.getHost(), lookupUri.getPort());
} | [
"static",
"RedisNodeDescription",
"findNodeByUri",
"(",
"Collection",
"<",
"RedisNodeDescription",
">",
"nodes",
",",
"RedisURI",
"lookupUri",
")",
"{",
"return",
"findNodeByHostAndPort",
"(",
"nodes",
",",
"lookupUri",
".",
"getHost",
"(",
")",
",",
"lookupUri",
... | Lookup a {@link RedisNodeDescription} by {@link RedisURI}.
@param nodes
@param lookupUri
@return the {@link RedisNodeDescription} or {@literal null} | [
"Lookup",
"a",
"{",
"@link",
"RedisNodeDescription",
"}",
"by",
"{",
"@link",
"RedisURI",
"}",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/masterslave/MasterSlaveUtils.java#L60-L62 |
alkacon/opencms-core | src/org/opencms/file/CmsRequestContext.java | CmsRequestContext.switchUser | protected void switchUser(CmsUser user, CmsProject project, String ouFqn) {
"""
Switches the user in the context, required after a login.<p>
@param user the new user to use
@param project the new users current project
@param ouFqn the organizational unit
"""
m_user = user;
m_currentProjec... | java | protected void switchUser(CmsUser user, CmsProject project, String ouFqn) {
m_user = user;
m_currentProject = project;
setOuFqn(ouFqn);
} | [
"protected",
"void",
"switchUser",
"(",
"CmsUser",
"user",
",",
"CmsProject",
"project",
",",
"String",
"ouFqn",
")",
"{",
"m_user",
"=",
"user",
";",
"m_currentProject",
"=",
"project",
";",
"setOuFqn",
"(",
"ouFqn",
")",
";",
"}"
] | Switches the user in the context, required after a login.<p>
@param user the new user to use
@param project the new users current project
@param ouFqn the organizational unit | [
"Switches",
"the",
"user",
"in",
"the",
"context",
"required",
"after",
"a",
"login",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsRequestContext.java#L694-L699 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/ParseLong.java | ParseLong.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null, isn't a Long or String, or can't be parsed as a Long
"""
validateInputNotNull(value, context);
final Long result;
if( value instanceof Long ) {
result... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
final Long result;
if( value instanceof Long ) {
result = (Long) value;
} else if( value instanceof String ) {
try {
result = Long.parseLong((String) value);
}
catch(final NumberFormatE... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"final",
"Long",
"result",
";",
"if",
"(",
"value",
"instanceof",
"Long",
")",
... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null, isn't a Long or String, or can't be parsed as a Long | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/ParseLong.java#L56-L77 |
OpenLiberty/open-liberty | dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/util/BlockingList.java | BlockingList.putIfAbsent | @FFDCIgnore(IllegalArgumentException.class)
public boolean putIfAbsent(K key, E element) {
"""
Add the element associated with the given key into the list at the established position for that key.
@param key the key to use to add the element, which must match one of the keys provided to the constructor
@pa... | java | @FFDCIgnore(IllegalArgumentException.class)
public boolean putIfAbsent(K key, E element) {
try {
put(key, element);
return true;
} catch (IllegalArgumentException e) {
return false;
}
} | [
"@",
"FFDCIgnore",
"(",
"IllegalArgumentException",
".",
"class",
")",
"public",
"boolean",
"putIfAbsent",
"(",
"K",
"key",
",",
"E",
"element",
")",
"{",
"try",
"{",
"put",
"(",
"key",
",",
"element",
")",
";",
"return",
"true",
";",
"}",
"catch",
"("... | Add the element associated with the given key into the list at the established position for that key.
@param key the key to use to add the element, which must match one of the keys provided to the constructor
@param element the element to add
@return <code>true</code> if the element was added and <code>false</code> ot... | [
"Add",
"the",
"element",
"associated",
"with",
"the",
"given",
"key",
"into",
"the",
"list",
"at",
"the",
"established",
"position",
"for",
"that",
"key",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/util/BlockingList.java#L484-L492 |
ludovicianul/selenium-on-steroids | src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java | WebDriverHelper.waitForElementToBeVisible | public void waitForElementToBeVisible(final By by, final int maximumSeconds) {
"""
Waits until a WebElement will be displayed into the page.
@param by
the method of identifying the element
@param maximumSeconds
the maximum number of seconds to wait
"""
WebDriverWait wait = new WebDriverWait(driver, max... | java | public void waitForElementToBeVisible(final By by, final int maximumSeconds) {
WebDriverWait wait = new WebDriverWait(driver, maximumSeconds);
wait.until(ExpectedConditions.visibilityOfElementLocated(by));
} | [
"public",
"void",
"waitForElementToBeVisible",
"(",
"final",
"By",
"by",
",",
"final",
"int",
"maximumSeconds",
")",
"{",
"WebDriverWait",
"wait",
"=",
"new",
"WebDriverWait",
"(",
"driver",
",",
"maximumSeconds",
")",
";",
"wait",
".",
"until",
"(",
"Expected... | Waits until a WebElement will be displayed into the page.
@param by
the method of identifying the element
@param maximumSeconds
the maximum number of seconds to wait | [
"Waits",
"until",
"a",
"WebElement",
"will",
"be",
"displayed",
"into",
"the",
"page",
"."
] | train | https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L498-L501 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/TempDir.java | TempDir.createFile | public File createFile(String relativePath, InputStream sourceData) throws IOException {
"""
Create a file within this temporary directory, prepopulating the file from the given input stream.
@param relativePath the relative path name
@param sourceData the source input stream to use
@return the file
@throw... | java | public File createFile(String relativePath, InputStream sourceData) throws IOException {
final File tempFile = getFile(relativePath);
boolean ok = false;
try {
final FileOutputStream fos = new FileOutputStream(tempFile);
try {
VFSUtils.copyStream(sourceDat... | [
"public",
"File",
"createFile",
"(",
"String",
"relativePath",
",",
"InputStream",
"sourceData",
")",
"throws",
"IOException",
"{",
"final",
"File",
"tempFile",
"=",
"getFile",
"(",
"relativePath",
")",
";",
"boolean",
"ok",
"=",
"false",
";",
"try",
"{",
"f... | Create a file within this temporary directory, prepopulating the file from the given input stream.
@param relativePath the relative path name
@param sourceData the source input stream to use
@return the file
@throws IOException if the directory was closed at the time of this invocation or an error occurs | [
"Create",
"a",
"file",
"within",
"this",
"temporary",
"directory",
"prepopulating",
"the",
"file",
"from",
"the",
"given",
"input",
"stream",
"."
] | train | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/TempDir.java#L80-L100 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/MP3FileID3Controller.java | MP3FileID3Controller.removeTags | public void removeTags(int type) throws FileNotFoundException, IOException {
"""
Removes id3 tags from the file. The argument specifies which tags to
remove. This can either be BOTH_TAGS, ID3V1_ONLY, ID3V2_ONLY, or
EXISTING_TAGS_ONLY.
@param type specifies what tag(s) to remove
@exception FileNotFoundExcep... | java | public void removeTags(int type) throws FileNotFoundException, IOException
{
RandomAccessFile raf = null;
try
{
raf = new RandomAccessFile(mp3File, "rw");
if (allow(type&ID3V1))
{
id3v1.removeTag(raf);
}
if (allow(type&ID3V2))
{
id3v2.removeTag(raf);
}
}
finally
{
if (raf !... | [
"public",
"void",
"removeTags",
"(",
"int",
"type",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"RandomAccessFile",
"raf",
"=",
"null",
";",
"try",
"{",
"raf",
"=",
"new",
"RandomAccessFile",
"(",
"mp3File",
",",
"\"rw\"",
")",
";",
"if"... | Removes id3 tags from the file. The argument specifies which tags to
remove. This can either be BOTH_TAGS, ID3V1_ONLY, ID3V2_ONLY, or
EXISTING_TAGS_ONLY.
@param type specifies what tag(s) to remove
@exception FileNotFoundException if an error occurs
@exception IOException if an error occurs | [
"Removes",
"id3",
"tags",
"from",
"the",
"file",
".",
"The",
"argument",
"specifies",
"which",
"tags",
"to",
"remove",
".",
"This",
"can",
"either",
"be",
"BOTH_TAGS",
"ID3V1_ONLY",
"ID3V2_ONLY",
"or",
"EXISTING_TAGS_ONLY",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/MP3FileID3Controller.java#L101-L121 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/kdtree/KDTree.java | KDTree.nn | public Pair<Double, INDArray> nn(INDArray point) {
"""
Query for nearest neighbor. Returns the distance and point
@param point the point to query for
@return
"""
return nn(root, point, rect, Double.POSITIVE_INFINITY, null, 0);
} | java | public Pair<Double, INDArray> nn(INDArray point) {
return nn(root, point, rect, Double.POSITIVE_INFINITY, null, 0);
} | [
"public",
"Pair",
"<",
"Double",
",",
"INDArray",
">",
"nn",
"(",
"INDArray",
"point",
")",
"{",
"return",
"nn",
"(",
"root",
",",
"point",
",",
"rect",
",",
"Double",
".",
"POSITIVE_INFINITY",
",",
"null",
",",
"0",
")",
";",
"}"
] | Query for nearest neighbor. Returns the distance and point
@param point the point to query for
@return | [
"Query",
"for",
"nearest",
"neighbor",
".",
"Returns",
"the",
"distance",
"and",
"point"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/kdtree/KDTree.java#L167-L169 |
infinispan/infinispan | core/src/main/java/org/infinispan/affinity/KeyAffinityServiceFactory.java | KeyAffinityServiceFactory.newKeyAffinityService | public static <K, V> KeyAffinityService<K> newKeyAffinityService(Cache<K, V> cache, Executor ex, KeyGenerator<K> keyGenerator, int keyBufferSize) {
"""
Same as {@link #newKeyAffinityService(org.infinispan.Cache, java.util.concurrent.Executor, KeyGenerator, int,
boolean)} with start == true;
"""
return n... | java | public static <K, V> KeyAffinityService<K> newKeyAffinityService(Cache<K, V> cache, Executor ex, KeyGenerator<K> keyGenerator, int keyBufferSize) {
return newKeyAffinityService(cache, ex, keyGenerator, keyBufferSize, true);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"KeyAffinityService",
"<",
"K",
">",
"newKeyAffinityService",
"(",
"Cache",
"<",
"K",
",",
"V",
">",
"cache",
",",
"Executor",
"ex",
",",
"KeyGenerator",
"<",
"K",
">",
"keyGenerator",
",",
"int",
"keyBufferSi... | Same as {@link #newKeyAffinityService(org.infinispan.Cache, java.util.concurrent.Executor, KeyGenerator, int,
boolean)} with start == true; | [
"Same",
"as",
"{"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/affinity/KeyAffinityServiceFactory.java#L49-L51 |
gallandarakhneorg/afc | advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/configs/Configs.java | Configs.defineScalar | public static void defineScalar(Map<String, Object> content, String bootiqueVariable, Object value) throws Exception {
"""
Add a scalar to a Yaml configuration map.
@param content the Yaml configuration map.
@param bootiqueVariable the name of the bootique variable.
@param value the value.
@throws Exception ... | java | public static void defineScalar(Map<String, Object> content, String bootiqueVariable, Object value) throws Exception {
final String[] elements = bootiqueVariable.split("\\."); //$NON-NLS-1$
final Map<String, Object> entry = getScalarParent(content, elements);
entry.put(elements[elements.length - 1], value);
} | [
"public",
"static",
"void",
"defineScalar",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"content",
",",
"String",
"bootiqueVariable",
",",
"Object",
"value",
")",
"throws",
"Exception",
"{",
"final",
"String",
"[",
"]",
"elements",
"=",
"bootiqueVariable",
... | Add a scalar to a Yaml configuration map.
@param content the Yaml configuration map.
@param bootiqueVariable the name of the bootique variable.
@param value the value.
@throws Exception if a map cannot be created internally. | [
"Add",
"a",
"scalar",
"to",
"a",
"Yaml",
"configuration",
"map",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/configs/Configs.java#L143-L147 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/date/DateCaster.java | DateCaster.toDateTime | public static DateTime toDateTime(Locale locale, String str, TimeZone tz, boolean useCommomDateParserAsWell) throws PageException {
"""
parse a string to a Datetime Object
@param locale
@param str String representation of a locale Date
@param tz
@return DateTime Object
@throws PageException
"""
DateTi... | java | public static DateTime toDateTime(Locale locale, String str, TimeZone tz, boolean useCommomDateParserAsWell) throws PageException {
DateTime dt = toDateTime(locale, str, tz, null, useCommomDateParserAsWell);
if (dt == null) {
String prefix = locale.getLanguage() + "-" + locale.getCountry() + "-";
throw new... | [
"public",
"static",
"DateTime",
"toDateTime",
"(",
"Locale",
"locale",
",",
"String",
"str",
",",
"TimeZone",
"tz",
",",
"boolean",
"useCommomDateParserAsWell",
")",
"throws",
"PageException",
"{",
"DateTime",
"dt",
"=",
"toDateTime",
"(",
"locale",
",",
"str",
... | parse a string to a Datetime Object
@param locale
@param str String representation of a locale Date
@param tz
@return DateTime Object
@throws PageException | [
"parse",
"a",
"string",
"to",
"a",
"Datetime",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/date/DateCaster.java#L186-L198 |
Netflix/dyno | dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java | Murmur2Hash.hash64 | public static long hash64(final String text, int from, int length) {
"""
Generates 64 bit hash from a substring.
@param text string to hash
@param from starting index
@param length length of the substring to hash
@return 64 bit hash of the given array
"""
return hash64(text.substring( from, from+... | java | public static long hash64(final String text, int from, int length) {
return hash64(text.substring( from, from+length));
} | [
"public",
"static",
"long",
"hash64",
"(",
"final",
"String",
"text",
",",
"int",
"from",
",",
"int",
"length",
")",
"{",
"return",
"hash64",
"(",
"text",
".",
"substring",
"(",
"from",
",",
"from",
"+",
"length",
")",
")",
";",
"}"
] | Generates 64 bit hash from a substring.
@param text string to hash
@param from starting index
@param length length of the substring to hash
@return 64 bit hash of the given array | [
"Generates",
"64",
"bit",
"hash",
"from",
"a",
"substring",
"."
] | train | https://github.com/Netflix/dyno/blob/158f807083ea8e9b09c8089cb07f98e954ad5b23/dyno-core/src/main/java/com/netflix/dyno/connectionpool/impl/hash/Murmur2Hash.java#L197-L199 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/OrmElf.java | OrmElf.statementToObject | public static <T> T statementToObject(PreparedStatement stmt, Class<T> clazz, Object... args) throws SQLException {
"""
This method takes a PreparedStatement, a target class, and optional arguments to set
as query parameters. It sets the parameters automatically, executes the query, and
constructs and populates ... | java | public static <T> T statementToObject(PreparedStatement stmt, Class<T> clazz, Object... args) throws SQLException
{
return OrmReader.statementToObject(stmt, clazz, args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"statementToObject",
"(",
"PreparedStatement",
"stmt",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"Object",
"...",
"args",
")",
"throws",
"SQLException",
"{",
"return",
"OrmReader",
".",
"statementToObject",
"(",
"stmt... | This method takes a PreparedStatement, a target class, and optional arguments to set
as query parameters. It sets the parameters automatically, executes the query, and
constructs and populates an instance of the target class. <b>The PreparedStatement will be closed.</b>
@param stmt the PreparedStatement to execute to ... | [
"This",
"method",
"takes",
"a",
"PreparedStatement",
"a",
"target",
"class",
"and",
"optional",
"arguments",
"to",
"set",
"as",
"query",
"parameters",
".",
"It",
"sets",
"the",
"parameters",
"automatically",
"executes",
"the",
"query",
"and",
"constructs",
"and"... | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/OrmElf.java#L136-L139 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasACL.java | BaasACL.hasUserGrant | public boolean hasUserGrant(Grant grant,BaasUser user) {
"""
Checks if the {@code user} has the specified {@code grant}
@param grant a {@link com.baasbox.android.Grant}
@param user a {@link com.baasbox.android.BaasUser}
@return
"""
if (user==null) throw new IllegalArgumentException("username cannot ... | java | public boolean hasUserGrant(Grant grant,BaasUser user){
if (user==null) throw new IllegalArgumentException("username cannot be null");
return hasUserGrant(grant, user.getName());
} | [
"public",
"boolean",
"hasUserGrant",
"(",
"Grant",
"grant",
",",
"BaasUser",
"user",
")",
"{",
"if",
"(",
"user",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"username cannot be null\"",
")",
";",
"return",
"hasUserGrant",
"(",
"grant",... | Checks if the {@code user} has the specified {@code grant}
@param grant a {@link com.baasbox.android.Grant}
@param user a {@link com.baasbox.android.BaasUser}
@return | [
"Checks",
"if",
"the",
"{"
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasACL.java#L114-L117 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java | NikeFS2SwapFileManager.cleanup | private static synchronized void cleanup() {
"""
Cleans up stale swap files and directories, left over from
previous sessions. Only swap directories for which no lock
file exists will be removed.
"""
int cleanedDirs = 0;
int cleanedFiles = 0;
// retrieve leftover swap directories
File[] swapDirs = TM... | java | private static synchronized void cleanup() {
int cleanedDirs = 0;
int cleanedFiles = 0;
// retrieve leftover swap directories
File[] swapDirs = TMP_DIR.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return pathname.getName().endsWith(SWAP_DIR_SUFFIX);
}
});
for(File swapDir : ... | [
"private",
"static",
"synchronized",
"void",
"cleanup",
"(",
")",
"{",
"int",
"cleanedDirs",
"=",
"0",
";",
"int",
"cleanedFiles",
"=",
"0",
";",
"// retrieve leftover swap directories",
"File",
"[",
"]",
"swapDirs",
"=",
"TMP_DIR",
".",
"listFiles",
"(",
"new... | Cleans up stale swap files and directories, left over from
previous sessions. Only swap directories for which no lock
file exists will be removed. | [
"Cleans",
"up",
"stale",
"swap",
"files",
"and",
"directories",
"left",
"over",
"from",
"previous",
"sessions",
".",
"Only",
"swap",
"directories",
"for",
"which",
"no",
"lock",
"file",
"exists",
"will",
"be",
"removed",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/nikefs2/NikeFS2SwapFileManager.java#L154-L174 |
weld/core | impl/src/main/java/org/jboss/weld/util/Beans.java | Beans.isPassivatingScope | public static boolean isPassivatingScope(Bean<?> bean, BeanManagerImpl manager) {
"""
Indicates if a bean's scope type is passivating
@param bean The bean to inspect
@return True if the scope is passivating, false otherwise
"""
if (bean == null) {
return false;
} else {
... | java | public static boolean isPassivatingScope(Bean<?> bean, BeanManagerImpl manager) {
if (bean == null) {
return false;
} else {
return manager.getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isPassivating();
}
} | [
"public",
"static",
"boolean",
"isPassivatingScope",
"(",
"Bean",
"<",
"?",
">",
"bean",
",",
"BeanManagerImpl",
"manager",
")",
"{",
"if",
"(",
"bean",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"return",
"manager",
".",
"getServi... | Indicates if a bean's scope type is passivating
@param bean The bean to inspect
@return True if the scope is passivating, false otherwise | [
"Indicates",
"if",
"a",
"bean",
"s",
"scope",
"type",
"is",
"passivating"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/util/Beans.java#L115-L121 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroReader.java | MicroReader.readMicroXML | @Nullable
public static IMicroDocument readMicroXML (@WillClose @Nullable final InputSource aInputSource,
@Nullable final ISAXReaderSettings aSettings) {
"""
Read the passed input source as MicroXML.
@param aInputSource
The input source to use. May be <code>null</... | java | @Nullable
public static IMicroDocument readMicroXML (@WillClose @Nullable final InputSource aInputSource,
@Nullable final ISAXReaderSettings aSettings)
{
if (aInputSource == null)
return null;
final EntityResolver aEntityResolver = aSettings == null ? null... | [
"@",
"Nullable",
"public",
"static",
"IMicroDocument",
"readMicroXML",
"(",
"@",
"WillClose",
"@",
"Nullable",
"final",
"InputSource",
"aInputSource",
",",
"@",
"Nullable",
"final",
"ISAXReaderSettings",
"aSettings",
")",
"{",
"if",
"(",
"aInputSource",
"==",
"nul... | Read the passed input source as MicroXML.
@param aInputSource
The input source to use. May be <code>null</code> in which case
<code>null</code> is directly returned.
@param aSettings
The settings to use. If <code>null</code> the default settings will
be used.
@return <code>null</code> if either the input source is <co... | [
"Read",
"the",
"passed",
"input",
"source",
"as",
"MicroXML",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroReader.java#L79-L109 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Resolution.java | Resolution.getScaled | public Resolution getScaled(double factorX, double factorY) {
"""
Get scaled resolution.
@param factorX The horizontal scale factor (strictly superior to 0).
@param factorY The vertical scale factor (strictly superior to 0).
@return The scaled resolution.
@throws LionEngineException If invalid arguments.
... | java | public Resolution getScaled(double factorX, double factorY)
{
Check.superiorStrict(factorX, 0);
Check.superiorStrict(factorY, 0);
return new Resolution((int) (width * factorX), (int) (height * factorY), rate);
} | [
"public",
"Resolution",
"getScaled",
"(",
"double",
"factorX",
",",
"double",
"factorY",
")",
"{",
"Check",
".",
"superiorStrict",
"(",
"factorX",
",",
"0",
")",
";",
"Check",
".",
"superiorStrict",
"(",
"factorY",
",",
"0",
")",
";",
"return",
"new",
"R... | Get scaled resolution.
@param factorX The horizontal scale factor (strictly superior to 0).
@param factorY The vertical scale factor (strictly superior to 0).
@return The scaled resolution.
@throws LionEngineException If invalid arguments. | [
"Get",
"scaled",
"resolution",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Resolution.java#L99-L105 |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java | RequestParam.getBoolean | public static boolean getBoolean(@NotNull ServletRequest request, @NotNull String param) {
"""
Returns a request parameter as boolean.
@param request Request.
@param param Parameter name.
@return Parameter value or <code>false</code> if it does not exist or cannot be interpreted as boolean.
"""
return g... | java | public static boolean getBoolean(@NotNull ServletRequest request, @NotNull String param) {
return getBoolean(request, param, false);
} | [
"public",
"static",
"boolean",
"getBoolean",
"(",
"@",
"NotNull",
"ServletRequest",
"request",
",",
"@",
"NotNull",
"String",
"param",
")",
"{",
"return",
"getBoolean",
"(",
"request",
",",
"param",
",",
"false",
")",
";",
"}"
] | Returns a request parameter as boolean.
@param request Request.
@param param Parameter name.
@return Parameter value or <code>false</code> if it does not exist or cannot be interpreted as boolean. | [
"Returns",
"a",
"request",
"parameter",
"as",
"boolean",
"."
] | train | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java#L233-L235 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.updateText | protected void updateText(PageElement pageElement, String textOrKey, Object... args) throws TechnicalException, FailureException {
"""
Update a html input text with a text.
@param pageElement
Is target element
@param textOrKey
Is the new data (text or text in context (after a save))
@param args
list of arg... | java | protected void updateText(PageElement pageElement, String textOrKey, Object... args) throws TechnicalException, FailureException {
updateText(pageElement, textOrKey, null, args);
} | [
"protected",
"void",
"updateText",
"(",
"PageElement",
"pageElement",
",",
"String",
"textOrKey",
",",
"Object",
"...",
"args",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"updateText",
"(",
"pageElement",
",",
"textOrKey",
",",
"null",
",",... | Update a html input text with a text.
@param pageElement
Is target element
@param textOrKey
Is the new data (text or text in context (after a save))
@param args
list of arguments to format the found selector with
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in ... | [
"Update",
"a",
"html",
"input",
"text",
"with",
"a",
"text",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L186-L188 |
paoding-code/paoding-rose | paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/impl/ExqlCompiler.java | ExqlCompiler.findRightBrace | private int findRightBrace(char chLeft, char chRight, int fromIndex) {
"""
查找匹配的右括号, 可以用于匹配 '{}', '[]', '()' 括号对。
如果未找到匹配的右括号,函数返回 -1.
@param string - 查找的字符串
@param chLeft - 匹配的左括号
@param chRight - 匹配的右括号
@param fromIndex - 查找的起始位置
@return 右括号的位置, 如果未找到匹配的右括号,函数返回 -1.
"""
int level = 0; //... | java | private int findRightBrace(char chLeft, char chRight, int fromIndex) {
int level = 0; // 记录括号重叠级别。
// 查找匹配的右括号。
for (int index = fromIndex; index < length; index++) {
char ch = pattern.charAt(index);
// 如果出现左括号,重叠级别增加。
if (ch == chLeft) {
l... | [
"private",
"int",
"findRightBrace",
"(",
"char",
"chLeft",
",",
"char",
"chRight",
",",
"int",
"fromIndex",
")",
"{",
"int",
"level",
"=",
"0",
";",
"// 记录括号重叠级别。",
"// 查找匹配的右括号。",
"for",
"(",
"int",
"index",
"=",
"fromIndex",
";",
"index",
"<",
"length",
... | 查找匹配的右括号, 可以用于匹配 '{}', '[]', '()' 括号对。
如果未找到匹配的右括号,函数返回 -1.
@param string - 查找的字符串
@param chLeft - 匹配的左括号
@param chRight - 匹配的右括号
@param fromIndex - 查找的起始位置
@return 右括号的位置, 如果未找到匹配的右括号,函数返回 -1. | [
"查找匹配的右括号",
"可以用于匹配",
"{}",
"[]",
"()",
"括号对。"
] | train | https://github.com/paoding-code/paoding-rose/blob/8b512704174dd6cba95e544c7d6ab66105cb8ec4/paoding-rose-jade/src/main/java/net/paoding/rose/jade/statement/expression/impl/ExqlCompiler.java#L319-L346 |
marklogic/marklogic-contentpump | mapreduce/src/main/java/com/marklogic/mapreduce/utilities/InternalUtilities.java | InternalUtilities.getInputContentSource | public static ContentSource getInputContentSource(Configuration conf)
throws URISyntaxException, XccConfigException, IOException {
"""
Get content source for input server.
@param conf job configuration.
@return ContentSource for input server.
@throws URISyntaxException
@throws XccConfigException
@throws ... | java | public static ContentSource getInputContentSource(Configuration conf)
throws URISyntaxException, XccConfigException, IOException {
String host = conf.getStrings(INPUT_HOST)[0];
if (host == null || host.isEmpty()) {
throw new IllegalArgumentException(INPUT_HOST +
" i... | [
"public",
"static",
"ContentSource",
"getInputContentSource",
"(",
"Configuration",
"conf",
")",
"throws",
"URISyntaxException",
",",
"XccConfigException",
",",
"IOException",
"{",
"String",
"host",
"=",
"conf",
".",
"getStrings",
"(",
"INPUT_HOST",
")",
"[",
"0",
... | Get content source for input server.
@param conf job configuration.
@return ContentSource for input server.
@throws URISyntaxException
@throws XccConfigException
@throws IOException | [
"Get",
"content",
"source",
"for",
"input",
"server",
"."
] | train | https://github.com/marklogic/marklogic-contentpump/blob/4c41e4a953301f81a4c655efb2a847603dee8afc/mapreduce/src/main/java/com/marklogic/mapreduce/utilities/InternalUtilities.java#L94-L103 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/style/RtfStylesheetList.java | RtfStylesheetList.registerParagraphStyle | public void registerParagraphStyle(RtfParagraphStyle rtfParagraphStyle) {
"""
Register a RtfParagraphStyle with this RtfStylesheetList.
@param rtfParagraphStyle The RtfParagraphStyle to add.
"""
RtfParagraphStyle tempStyle = new RtfParagraphStyle(this.document, rtfParagraphStyle);
tempStyle.... | java | public void registerParagraphStyle(RtfParagraphStyle rtfParagraphStyle) {
RtfParagraphStyle tempStyle = new RtfParagraphStyle(this.document, rtfParagraphStyle);
tempStyle.handleInheritance();
tempStyle.setStyleNumber(this.styleMap.size());
this.styleMap.put(tempStyle.getStyleName(), temp... | [
"public",
"void",
"registerParagraphStyle",
"(",
"RtfParagraphStyle",
"rtfParagraphStyle",
")",
"{",
"RtfParagraphStyle",
"tempStyle",
"=",
"new",
"RtfParagraphStyle",
"(",
"this",
".",
"document",
",",
"rtfParagraphStyle",
")",
";",
"tempStyle",
".",
"handleInheritance... | Register a RtfParagraphStyle with this RtfStylesheetList.
@param rtfParagraphStyle The RtfParagraphStyle to add. | [
"Register",
"a",
"RtfParagraphStyle",
"with",
"this",
"RtfStylesheetList",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/style/RtfStylesheetList.java#L103-L108 |
Azure/azure-sdk-for-java | dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java | RecordSetsInner.createOrUpdate | public RecordSetInner createOrUpdate(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType, RecordSetInner parameters, String ifMatch, String ifNoneMatch) {
"""
Creates or updates a record set within a DNS zone.
@param resourceGroupName The name of the resource group.
@... | java | public RecordSetInner createOrUpdate(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType, RecordSetInner parameters, String ifMatch, String ifNoneMatch) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, para... | [
"public",
"RecordSetInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"zoneName",
",",
"String",
"relativeRecordSetName",
",",
"RecordType",
"recordType",
",",
"RecordSetInner",
"parameters",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMat... | Creates or updates a record set within a DNS zone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (without a terminating dot).
@param relativeRecordSetName The name of the record set, relative to the name of the zone.
@param recordType The type of DNS record in this r... | [
"Creates",
"or",
"updates",
"a",
"record",
"set",
"within",
"a",
"DNS",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/RecordSetsInner.java#L432-L434 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPConnection.java | RTMPConnection.getChannel | public Channel getChannel(int channelId) {
"""
Return channel by id.
@param channelId
Channel id
@return Channel by id
"""
Channel channel = channels.putIfAbsent(channelId, new Channel(this, channelId));
if (channel == null) {
channel = channels.get(channelId);
}
... | java | public Channel getChannel(int channelId) {
Channel channel = channels.putIfAbsent(channelId, new Channel(this, channelId));
if (channel == null) {
channel = channels.get(channelId);
}
return channel;
} | [
"public",
"Channel",
"getChannel",
"(",
"int",
"channelId",
")",
"{",
"Channel",
"channel",
"=",
"channels",
".",
"putIfAbsent",
"(",
"channelId",
",",
"new",
"Channel",
"(",
"this",
",",
"channelId",
")",
")",
";",
"if",
"(",
"channel",
"==",
"null",
")... | Return channel by id.
@param channelId
Channel id
@return Channel by id | [
"Return",
"channel",
"by",
"id",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPConnection.java#L626-L632 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.beginMoveResourcesAsync | public Observable<Void> beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
"""
Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When... | java | public Observable<Void> beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
return beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse... | [
"public",
"Observable",
"<",
"Void",
">",
"beginMoveResourcesAsync",
"(",
"String",
"sourceResourceGroupName",
",",
"ResourcesMoveInfo",
"parameters",
")",
"{",
"return",
"beginMoveResourcesWithServiceResponseAsync",
"(",
"sourceResourceGroupName",
",",
"parameters",
")",
"... | Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and dele... | [
"Moves",
"resources",
"from",
"one",
"resource",
"group",
"to",
"another",
"resource",
"group",
".",
"The",
"resources",
"to",
"move",
"must",
"be",
"in",
"the",
"same",
"source",
"resource",
"group",
".",
"The",
"target",
"resource",
"group",
"may",
"be",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L518-L525 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java | ModificationBuilderTarget.addBundle | public T addBundle(final String moduleName, final String slot, final byte[] newHash) {
"""
Add a bundle.
@param moduleName the module name
@param slot the module slot
@param newHash the new hash of the added content
@return the builder
"""
final ContentItem item = createBundleItem(moduleName, slo... | java | public T addBundle(final String moduleName, final String slot, final byte[] newHash) {
final ContentItem item = createBundleItem(moduleName, slot, newHash);
addContentModification(createContentModification(item, ModificationType.ADD, NO_CONTENT));
return returnThis();
} | [
"public",
"T",
"addBundle",
"(",
"final",
"String",
"moduleName",
",",
"final",
"String",
"slot",
",",
"final",
"byte",
"[",
"]",
"newHash",
")",
"{",
"final",
"ContentItem",
"item",
"=",
"createBundleItem",
"(",
"moduleName",
",",
"slot",
",",
"newHash",
... | Add a bundle.
@param moduleName the module name
@param slot the module slot
@param newHash the new hash of the added content
@return the builder | [
"Add",
"a",
"bundle",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/metadata/ModificationBuilderTarget.java#L72-L76 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/YearRangeRandomizer.java | YearRangeRandomizer.aNewYearRangeRandomizer | public static YearRangeRandomizer aNewYearRangeRandomizer(final Year min, final Year max, final long seed) {
"""
Create a new {@link YearRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link YearRangeRandomizer}.
"""
return new YearRangeRandom... | java | public static YearRangeRandomizer aNewYearRangeRandomizer(final Year min, final Year max, final long seed) {
return new YearRangeRandomizer(min, max, seed);
} | [
"public",
"static",
"YearRangeRandomizer",
"aNewYearRangeRandomizer",
"(",
"final",
"Year",
"min",
",",
"final",
"Year",
"max",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"YearRangeRandomizer",
"(",
"min",
",",
"max",
",",
"seed",
")",
";",
"}"... | Create a new {@link YearRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link YearRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"YearRangeRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/YearRangeRandomizer.java#L76-L78 |
lucee/Lucee | core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java | AbstrCFMLExprTransformer.startElement | private Variable startElement(Data data, Identifier name, Position line) throws TemplateException {
"""
Extrahiert den Start Element einer Variale, dies ist entweder eine Funktion, eine Scope
Definition oder eine undefinierte Variable. <br />
EBNF:<br />
<code>identifier "(" functionArg ")" | scope | identifier... | java | private Variable startElement(Data data, Identifier name, Position line) throws TemplateException {
// check function
if (data.srcCode.isCurrent('(')) {
FunctionMember func = getFunctionMember(data, name, true);
Variable var = name.getFactory().createVariable(line, data.srcCode.getPosition());
var.ad... | [
"private",
"Variable",
"startElement",
"(",
"Data",
"data",
",",
"Identifier",
"name",
",",
"Position",
"line",
")",
"throws",
"TemplateException",
"{",
"// check function",
"if",
"(",
"data",
".",
"srcCode",
".",
"isCurrent",
"(",
"'",
"'",
")",
")",
"{",
... | Extrahiert den Start Element einer Variale, dies ist entweder eine Funktion, eine Scope
Definition oder eine undefinierte Variable. <br />
EBNF:<br />
<code>identifier "(" functionArg ")" | scope | identifier;</code>
@param name Einstiegsname
@return CFXD Element
@throws TemplateException | [
"Extrahiert",
"den",
"Start",
"Element",
"einer",
"Variale",
"dies",
"ist",
"entweder",
"eine",
"Funktion",
"eine",
"Scope",
"Definition",
"oder",
"eine",
"undefinierte",
"Variable",
".",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">",
"identifi... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java#L1593-L1616 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/TypeToStringUtils.java | TypeToStringUtils.toStringTypes | public static String toStringTypes(final Type[] types, final Map<String, Type> generics) {
"""
Shortcut for {@link #toStringTypes(Type[], String, Map)} with comma separator (most commonly used).
@param types types to convert to string
@param generics generics (common for all types)
@return string with all ... | java | public static String toStringTypes(final Type[] types, final Map<String, Type> generics) {
return toStringTypes(types, COMMA_SEPARATOR, generics);
} | [
"public",
"static",
"String",
"toStringTypes",
"(",
"final",
"Type",
"[",
"]",
"types",
",",
"final",
"Map",
"<",
"String",
",",
"Type",
">",
"generics",
")",
"{",
"return",
"toStringTypes",
"(",
"types",
",",
"COMMA_SEPARATOR",
",",
"generics",
")",
";",
... | Shortcut for {@link #toStringTypes(Type[], String, Map)} with comma separator (most commonly used).
@param types types to convert to string
@param generics generics (common for all types)
@return string with all types divided by comma
@throws UnknownGenericException when found generic not declared on type (e.g. met... | [
"Shortcut",
"for",
"{",
"@link",
"#toStringTypes",
"(",
"Type",
"[]",
"String",
"Map",
")",
"}",
"with",
"comma",
"separator",
"(",
"most",
"commonly",
"used",
")",
"."
] | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/TypeToStringUtils.java#L130-L132 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java | MessagingSecurityServiceImpl.printDestinationPermissions | private void printDestinationPermissions(Map<String, ?> destinationPermissions) {
"""
Print the Destination Permissions, it will be used for debugging purpose
"""
Set<String> destinations = destinationPermissions.keySet();
for (String destination : destinations) {
SibTr.debug(tc, CL... | java | private void printDestinationPermissions(Map<String, ?> destinationPermissions) {
Set<String> destinations = destinationPermissions.keySet();
for (String destination : destinations) {
SibTr.debug(tc, CLASS_NAME + " Destination: " + destination);
Permission permission = (Permissio... | [
"private",
"void",
"printDestinationPermissions",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"destinationPermissions",
")",
"{",
"Set",
"<",
"String",
">",
"destinations",
"=",
"destinationPermissions",
".",
"keySet",
"(",
")",
";",
"for",
"(",
"String",
"desti... | Print the Destination Permissions, it will be used for debugging purpose | [
"Print",
"the",
"Destination",
"Permissions",
"it",
"will",
"be",
"used",
"for",
"debugging",
"purpose"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.security/src/com/ibm/ws/messaging/security/internal/MessagingSecurityServiceImpl.java#L624-L643 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Distribution.java | Distribution.simpleGoodTuring | public static <E> Distribution<E> simpleGoodTuring(Counter<E> counter, int numberOfKeys) {
"""
Creates a Distribution from the given counter using Gale & Sampsons'
"simple Good-Turing" smoothing.
@return a new simple Good-Turing smoothed Distribution.
"""
// check arguments
validateCounter(... | java | public static <E> Distribution<E> simpleGoodTuring(Counter<E> counter, int numberOfKeys) {
// check arguments
validateCounter(counter);
int numUnseen = numberOfKeys - counter.size();
if (numUnseen < 1)
throw new IllegalArgumentException(String.format("ERROR: numberOfKeys %d must be > size o... | [
"public",
"static",
"<",
"E",
">",
"Distribution",
"<",
"E",
">",
"simpleGoodTuring",
"(",
"Counter",
"<",
"E",
">",
"counter",
",",
"int",
"numberOfKeys",
")",
"{",
"// check arguments\r",
"validateCounter",
"(",
"counter",
")",
";",
"int",
"numUnseen",
"="... | Creates a Distribution from the given counter using Gale & Sampsons'
"simple Good-Turing" smoothing.
@return a new simple Good-Turing smoothed Distribution. | [
"Creates",
"a",
"Distribution",
"from",
"the",
"given",
"counter",
"using",
"Gale",
"&",
";",
"Sampsons",
"simple",
"Good",
"-",
"Turing",
"smoothing",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Distribution.java#L450-L483 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/core/services/MethodServices.java | MethodServices.checkMethod | void checkMethod(Method method, List<Object> arguments, List<String> parameters, int nbparam) throws IllegalArgumentException, JsonUnmarshallingException, JsonMarshallerException {
"""
Check if for nbparam in parameters the method is correct. If yes, store parameters String converted to Java in arguments list
@... | java | void checkMethod(Method method, List<Object> arguments, List<String> parameters, int nbparam) throws IllegalArgumentException, JsonUnmarshallingException, JsonMarshallerException {
Type[] paramTypes = method.getGenericParameterTypes();
Annotation[][] parametersAnnotations = method.getParameterAnnotations();
in... | [
"void",
"checkMethod",
"(",
"Method",
"method",
",",
"List",
"<",
"Object",
">",
"arguments",
",",
"List",
"<",
"String",
">",
"parameters",
",",
"int",
"nbparam",
")",
"throws",
"IllegalArgumentException",
",",
"JsonUnmarshallingException",
",",
"JsonMarshallerEx... | Check if for nbparam in parameters the method is correct. If yes, store parameters String converted to Java in arguments list
@param method
@param arguments
@param parameters
@param nbparam
@throws IllegalArgumentException
@throws JsonUnmarshallingException | [
"Check",
"if",
"for",
"nbparam",
"in",
"parameters",
"the",
"method",
"is",
"correct",
".",
"If",
"yes",
"store",
"parameters",
"String",
"converted",
"to",
"Java",
"in",
"arguments",
"list"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/core/services/MethodServices.java#L112-L124 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java | Polygon.pointsAsRect | public static ArrayList<IGeoPoint> pointsAsRect(GeoPoint center, double lengthInMeters, double widthInMeters) {
"""
Build a list of GeoPoint as a rectangle.
@param center of the rectangle
@param lengthInMeters on longitude
@param widthInMeters on latitude
@return the list of 4 GeoPoint
"""
ArrayList<IGeo... | java | public static ArrayList<IGeoPoint> pointsAsRect(GeoPoint center, double lengthInMeters, double widthInMeters){
ArrayList<IGeoPoint> points = new ArrayList<IGeoPoint>(4);
GeoPoint east = center.destinationPoint(lengthInMeters*0.5, 90.0f);
GeoPoint south = center.destinationPoint(widthInMeters*0.5, 180.0f);
doubl... | [
"public",
"static",
"ArrayList",
"<",
"IGeoPoint",
">",
"pointsAsRect",
"(",
"GeoPoint",
"center",
",",
"double",
"lengthInMeters",
",",
"double",
"widthInMeters",
")",
"{",
"ArrayList",
"<",
"IGeoPoint",
">",
"points",
"=",
"new",
"ArrayList",
"<",
"IGeoPoint",... | Build a list of GeoPoint as a rectangle.
@param center of the rectangle
@param lengthInMeters on longitude
@param widthInMeters on latitude
@return the list of 4 GeoPoint | [
"Build",
"a",
"list",
"of",
"GeoPoint",
"as",
"a",
"rectangle",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java#L228-L239 |
netty/netty | transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java | AbstractKQueueStreamChannel.doWriteSingle | protected int doWriteSingle(ChannelOutboundBuffer in) throws Exception {
"""
Attempt to write a single object.
@param in the collection which contains objects to write.
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}. The typical use ... | java | protected int doWriteSingle(ChannelOutboundBuffer in) throws Exception {
// The outbound buffer contains only one message or it contains a file region.
Object msg = in.current();
if (msg instanceof ByteBuf) {
return writeBytes(in, (ByteBuf) msg);
} else if (msg instanceof Def... | [
"protected",
"int",
"doWriteSingle",
"(",
"ChannelOutboundBuffer",
"in",
")",
"throws",
"Exception",
"{",
"// The outbound buffer contains only one message or it contains a file region.",
"Object",
"msg",
"=",
"in",
".",
"current",
"(",
")",
";",
"if",
"(",
"msg",
"inst... | Attempt to write a single object.
@param in the collection which contains objects to write.
@return The value that should be decremented from the write quantum which starts at
{@link ChannelConfig#getWriteSpinCount()}. The typical use cases are as follows:
<ul>
<li>0 - if no write was attempted. This is appropriate if ... | [
"Attempt",
"to",
"write",
"a",
"single",
"object",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueStreamChannel.java#L319-L332 |
zxing/zxing | core/src/main/java/com/google/zxing/client/result/ProductResultParser.java | ProductResultParser.parse | @Override
public ProductParsedResult parse(Result result) {
"""
Treat all UPC and EAN variants as UPCs, in the sense that they are all product barcodes.
"""
BarcodeFormat format = result.getBarcodeFormat();
if (!(format == BarcodeFormat.UPC_A || format == BarcodeFormat.UPC_E ||
format == Ba... | java | @Override
public ProductParsedResult parse(Result result) {
BarcodeFormat format = result.getBarcodeFormat();
if (!(format == BarcodeFormat.UPC_A || format == BarcodeFormat.UPC_E ||
format == BarcodeFormat.EAN_8 || format == BarcodeFormat.EAN_13)) {
return null;
}
String rawText = getM... | [
"@",
"Override",
"public",
"ProductParsedResult",
"parse",
"(",
"Result",
"result",
")",
"{",
"BarcodeFormat",
"format",
"=",
"result",
".",
"getBarcodeFormat",
"(",
")",
";",
"if",
"(",
"!",
"(",
"format",
"==",
"BarcodeFormat",
".",
"UPC_A",
"||",
"format"... | Treat all UPC and EAN variants as UPCs, in the sense that they are all product barcodes. | [
"Treat",
"all",
"UPC",
"and",
"EAN",
"variants",
"as",
"UPCs",
"in",
"the",
"sense",
"that",
"they",
"are",
"all",
"product",
"barcodes",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/client/result/ProductResultParser.java#L31-L53 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/TargetsApi.java | TargetsApi.addRecentTarget | public void addRecentTarget(Target target, String media) throws WorkspaceApiException {
"""
Add a target that the agent recently used.
@param target The target to add.
@param media The media channel on which the target was used.
"""
addRecentTarget(target,media,System.currentTimeMillis());
} | java | public void addRecentTarget(Target target, String media) throws WorkspaceApiException {
addRecentTarget(target,media,System.currentTimeMillis());
} | [
"public",
"void",
"addRecentTarget",
"(",
"Target",
"target",
",",
"String",
"media",
")",
"throws",
"WorkspaceApiException",
"{",
"addRecentTarget",
"(",
"target",
",",
"media",
",",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"}"
] | Add a target that the agent recently used.
@param target The target to add.
@param media The media channel on which the target was used. | [
"Add",
"a",
"target",
"that",
"the",
"agent",
"recently",
"used",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/TargetsApi.java#L101-L103 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java | AbstractXbaseSemanticSequencer.sequence_XWhileExpression | protected void sequence_XWhileExpression(ISerializationContext context, XWhileExpression semanticObject) {
"""
Contexts:
XExpression returns XWhileExpression
XAssignment returns XWhileExpression
XAssignment.XBinaryOperation_1_1_0_0_0 returns XWhileExpression
XOrExpression returns XWhileExpression
XOrExpressio... | java | protected void sequence_XWhileExpression(ISerializationContext context, XWhileExpression semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XbasePackage.Literals.XABSTRACT_WHILE_EXPRESSION__PREDICATE) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvide... | [
"protected",
"void",
"sequence_XWhileExpression",
"(",
"ISerializationContext",
"context",
",",
"XWhileExpression",
"semanticObject",
")",
"{",
"if",
"(",
"errorAcceptor",
"!=",
"null",
")",
"{",
"if",
"(",
"transientValues",
".",
"isValueTransient",
"(",
"semanticObj... | Contexts:
XExpression returns XWhileExpression
XAssignment returns XWhileExpression
XAssignment.XBinaryOperation_1_1_0_0_0 returns XWhileExpression
XOrExpression returns XWhileExpression
XOrExpression.XBinaryOperation_1_0_0_0 returns XWhileExpression
XAndExpression returns XWhileExpression
XAndExpression.XBinaryOperati... | [
"Contexts",
":",
"XExpression",
"returns",
"XWhileExpression",
"XAssignment",
"returns",
"XWhileExpression",
"XAssignment",
".",
"XBinaryOperation_1_1_0_0_0",
"returns",
"XWhileExpression",
"XOrExpression",
"returns",
"XWhileExpression",
"XOrExpression",
".",
"XBinaryOperation_1_... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/serializer/AbstractXbaseSemanticSequencer.java#L1832-L1843 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.releaseOrphanedTriggers | protected void releaseOrphanedTriggers(RedisTriggerState currentState, RedisTriggerState newState, T jedis) throws JobPersistenceException {
"""
Release triggers from the given current state to the new state if its locking scheduler has not
registered as alive in the last 10 minutes
@param currentState the curre... | java | protected void releaseOrphanedTriggers(RedisTriggerState currentState, RedisTriggerState newState, T jedis) throws JobPersistenceException {
for (Tuple triggerTuple : jedis.zrangeWithScores(redisSchema.triggerStateKey(currentState), 0, -1)) {
final String lockId = jedis.get(redisSchema.triggerLockKe... | [
"protected",
"void",
"releaseOrphanedTriggers",
"(",
"RedisTriggerState",
"currentState",
",",
"RedisTriggerState",
"newState",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"for",
"(",
"Tuple",
"triggerTuple",
":",
"jedis",
".",
"zrangeWithScores",
... | Release triggers from the given current state to the new state if its locking scheduler has not
registered as alive in the last 10 minutes
@param currentState the current state of the orphaned trigger
@param newState the new state of the orphaned trigger
@param jedis a thread-safe Redis connection | [
"Release",
"triggers",
"from",
"the",
"given",
"current",
"state",
"to",
"the",
"new",
"state",
"if",
"its",
"locking",
"scheduler",
"has",
"not",
"registered",
"as",
"alive",
"in",
"the",
"last",
"10",
"minutes"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L672-L681 |
gallandarakhneorg/afc | core/text/src/main/java/org/arakhne/afc/text/TextUtil.java | TextUtil.toUpperCaseWithoutAccent | @Pure
public static String toUpperCaseWithoutAccent(String text, Map<Character, String> map) {
"""
Translate the specified string to upper case and remove the accents.
@param text is the text to scan.
@param map is the translation table from an accentuated character to an
unaccentuated character.
@return th... | java | @Pure
public static String toUpperCaseWithoutAccent(String text, Map<Character, String> map) {
final StringBuilder buffer = new StringBuilder();
for (final char c : text.toCharArray()) {
final String trans = map.get(c);
if (trans != null) {
buffer.append(trans.toUpperCase());
} else {
buffer.appen... | [
"@",
"Pure",
"public",
"static",
"String",
"toUpperCaseWithoutAccent",
"(",
"String",
"text",
",",
"Map",
"<",
"Character",
",",
"String",
">",
"map",
")",
"{",
"final",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"fi... | Translate the specified string to upper case and remove the accents.
@param text is the text to scan.
@param map is the translation table from an accentuated character to an
unaccentuated character.
@return the given string without the accents and upper cased | [
"Translate",
"the",
"specified",
"string",
"to",
"upper",
"case",
"and",
"remove",
"the",
"accents",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/text/src/main/java/org/arakhne/afc/text/TextUtil.java#L1439-L1451 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Instant.java | Instant.plus | private Instant plus(long secondsToAdd, long nanosToAdd) {
"""
Returns a copy of this instant with the specified duration added.
<p>
This instance is immutable and unaffected by this method call.
@param secondsToAdd the seconds to add, positive or negative
@param nanosToAdd the nanos to add, positive or ne... | java | private Instant plus(long secondsToAdd, long nanosToAdd) {
if ((secondsToAdd | nanosToAdd) == 0) {
return this;
}
long epochSec = Math.addExact(seconds, secondsToAdd);
epochSec = Math.addExact(epochSec, nanosToAdd / NANOS_PER_SECOND);
nanosToAdd = nanosToAdd % NANOS_P... | [
"private",
"Instant",
"plus",
"(",
"long",
"secondsToAdd",
",",
"long",
"nanosToAdd",
")",
"{",
"if",
"(",
"(",
"secondsToAdd",
"|",
"nanosToAdd",
")",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"epochSec",
"=",
"Math",
".",
"addExact",
"... | Returns a copy of this instant with the specified duration added.
<p>
This instance is immutable and unaffected by this method call.
@param secondsToAdd the seconds to add, positive or negative
@param nanosToAdd the nanos to add, positive or negative
@return an {@code Instant} based on this instant with the specifie... | [
"Returns",
"a",
"copy",
"of",
"this",
"instant",
"with",
"the",
"specified",
"duration",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Instant.java#L915-L924 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/RemoveBrownPtoN_F64.java | RemoveBrownPtoN_F64.compute | @Override
public void compute(double x, double y, Point2D_F64 out) {
"""
Removes radial distortion
@param x Distorted x-coordinate pixel
@param y Distorted y-coordinate pixel
@param out Undistorted normalized coordinate.
"""
// initial estimate of undistorted point
out.x = a11*x + a12*y + a13;
out.... | java | @Override
public void compute(double x, double y, Point2D_F64 out) {
// initial estimate of undistorted point
out.x = a11*x + a12*y + a13;
out.y = a22*y + a23;
removeRadial(out.x, out.y, params.radial, params.t1, params.t2, out, tol );
} | [
"@",
"Override",
"public",
"void",
"compute",
"(",
"double",
"x",
",",
"double",
"y",
",",
"Point2D_F64",
"out",
")",
"{",
"// initial estimate of undistorted point",
"out",
".",
"x",
"=",
"a11",
"*",
"x",
"+",
"a12",
"*",
"y",
"+",
"a13",
";",
"out",
... | Removes radial distortion
@param x Distorted x-coordinate pixel
@param y Distorted y-coordinate pixel
@param out Undistorted normalized coordinate. | [
"Removes",
"radial",
"distortion"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/brown/RemoveBrownPtoN_F64.java#L99-L106 |
crnk-project/crnk-framework | crnk-core/src/main/java/io/crnk/core/engine/internal/utils/PropertyUtils.java | PropertyUtils.getPropertyType | public static Type getPropertyType(Class<?> beanClass, String field) {
"""
Similar to {@link PropertyUtils#getPropertyClass(Class, List)} but returns the property class.
@param beanClass bean to be accessed
@param field bean's fieldName
@return bean's property class
"""
return INSTANCE.findPropertyT... | java | public static Type getPropertyType(Class<?> beanClass, String field) {
return INSTANCE.findPropertyType(beanClass, field);
} | [
"public",
"static",
"Type",
"getPropertyType",
"(",
"Class",
"<",
"?",
">",
"beanClass",
",",
"String",
"field",
")",
"{",
"return",
"INSTANCE",
".",
"findPropertyType",
"(",
"beanClass",
",",
"field",
")",
";",
"}"
] | Similar to {@link PropertyUtils#getPropertyClass(Class, List)} but returns the property class.
@param beanClass bean to be accessed
@param field bean's fieldName
@return bean's property class | [
"Similar",
"to",
"{",
"@link",
"PropertyUtils#getPropertyClass",
"(",
"Class",
"List",
")",
"}",
"but",
"returns",
"the",
"property",
"class",
"."
] | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/engine/internal/utils/PropertyUtils.java#L75-L77 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/Client.java | Client.controlEventHandler | public void controlEventHandler(final ControlEventHandler controlEventHandler) {
"""
Stores a {@link ControlEventHandler} to be called when control events happen.
<p>
All events (passed as {@link ByteBuf}s) that the callback receives need to be handled
and at least released (by using {@link ByteBuf#release()}, ... | java | public void controlEventHandler(final ControlEventHandler controlEventHandler) {
env.setControlEventHandler(new ControlEventHandler() {
@Override
public void onEvent(ChannelFlowController flowController, ByteBuf event) {
if (DcpSnapshotMarkerRequest.is(event)) {
// Keep snapshot inform... | [
"public",
"void",
"controlEventHandler",
"(",
"final",
"ControlEventHandler",
"controlEventHandler",
")",
"{",
"env",
".",
"setControlEventHandler",
"(",
"new",
"ControlEventHandler",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onEvent",
"(",
"ChannelFlowContro... | Stores a {@link ControlEventHandler} to be called when control events happen.
<p>
All events (passed as {@link ByteBuf}s) that the callback receives need to be handled
and at least released (by using {@link ByteBuf#release()}, otherwise they will leak.
<p>
The following messages can happen and should be handled dependi... | [
"Stores",
"a",
"{",
"@link",
"ControlEventHandler",
"}",
"to",
"be",
"called",
"when",
"control",
"events",
"happen",
".",
"<p",
">",
"All",
"events",
"(",
"passed",
"as",
"{",
"@link",
"ByteBuf",
"}",
"s",
")",
"that",
"the",
"callback",
"receives",
"ne... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/Client.java#L219-L250 |
prestodb/presto | presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/IndexLookup.java | IndexLookup.inRange | private static boolean inRange(Text text, Collection<Range> ranges) {
"""
Gets a Boolean value indicating if the given value is in one of the Ranges in the given collection
@param text Text object to check against the Range collection
@param ranges Ranges to look into
@return True if the text object is in one... | java | private static boolean inRange(Text text, Collection<Range> ranges)
{
Key kCq = new Key(text);
return ranges.stream().anyMatch(r -> !r.beforeStartKey(kCq) && !r.afterEndKey(kCq));
} | [
"private",
"static",
"boolean",
"inRange",
"(",
"Text",
"text",
",",
"Collection",
"<",
"Range",
">",
"ranges",
")",
"{",
"Key",
"kCq",
"=",
"new",
"Key",
"(",
"text",
")",
";",
"return",
"ranges",
".",
"stream",
"(",
")",
".",
"anyMatch",
"(",
"r",
... | Gets a Boolean value indicating if the given value is in one of the Ranges in the given collection
@param text Text object to check against the Range collection
@param ranges Ranges to look into
@return True if the text object is in one of the ranges, false otherwise | [
"Gets",
"a",
"Boolean",
"value",
"indicating",
"if",
"the",
"given",
"value",
"is",
"in",
"one",
"of",
"the",
"Ranges",
"in",
"the",
"given",
"collection"
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/index/IndexLookup.java#L396-L400 |
maxschuster/Vaadin-SignatureField | vaadin-signaturefield/src/main/java/eu/maxschuster/vaadin/signaturefield/SignatureFieldExtension.java | SignatureFieldExtension.setSignature | public void setSignature(String signature, boolean repaintIsNotNeeded) {
"""
Set signature current signature value.
@param signature Signature
@param repaintIsNotNeeded Repaint is not needed
"""
String oldSignature = this.signature;
if (!SharedUtil.equals(oldSignature, signature)) {
... | java | public void setSignature(String signature, boolean repaintIsNotNeeded) {
String oldSignature = this.signature;
if (!SharedUtil.equals(oldSignature, signature)) {
this.signature = signature;
if (!repaintIsNotNeeded) {
updateSignature();
}
... | [
"public",
"void",
"setSignature",
"(",
"String",
"signature",
",",
"boolean",
"repaintIsNotNeeded",
")",
"{",
"String",
"oldSignature",
"=",
"this",
".",
"signature",
";",
"if",
"(",
"!",
"SharedUtil",
".",
"equals",
"(",
"oldSignature",
",",
"signature",
")",... | Set signature current signature value.
@param signature Signature
@param repaintIsNotNeeded Repaint is not needed | [
"Set",
"signature",
"current",
"signature",
"value",
"."
] | train | https://github.com/maxschuster/Vaadin-SignatureField/blob/b6f6b7042ea9c46060af54bd92d21770abfcccee/vaadin-signaturefield/src/main/java/eu/maxschuster/vaadin/signaturefield/SignatureFieldExtension.java#L170-L178 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/internal/io/Schema.java | Schema.mapOf | public static Schema mapOf(Schema keySchema, Schema valueSchema) {
"""
Creates a {@link Type#MAP MAP} {@link Schema} of the given key and value types.
@param keySchema Schema of the map key.
@param valueSchema Schema of the map value
@return A {@link Schema} of {@link Type#MAP MAP} type.
"""
return new ... | java | public static Schema mapOf(Schema keySchema, Schema valueSchema) {
return new Schema(Type.MAP, null, null, keySchema, valueSchema, null, null, null);
} | [
"public",
"static",
"Schema",
"mapOf",
"(",
"Schema",
"keySchema",
",",
"Schema",
"valueSchema",
")",
"{",
"return",
"new",
"Schema",
"(",
"Type",
".",
"MAP",
",",
"null",
",",
"null",
",",
"keySchema",
",",
"valueSchema",
",",
"null",
",",
"null",
",",
... | Creates a {@link Type#MAP MAP} {@link Schema} of the given key and value types.
@param keySchema Schema of the map key.
@param valueSchema Schema of the map value
@return A {@link Schema} of {@link Type#MAP MAP} type. | [
"Creates",
"a",
"{"
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/internal/io/Schema.java#L185-L187 |
mozilla/rhino | src/org/mozilla/javascript/MemberBox.java | MemberBox.writeMember | private static void writeMember(ObjectOutputStream out, Executable member)
throws IOException {
"""
Writes a Constructor or Method object.
Methods and Constructors are not serializable, so we must serialize
information about the class, the name, and the parameters and
recreate upon deserialization.
... | java | private static void writeMember(ObjectOutputStream out, Executable member)
throws IOException
{
if (member == null) {
out.writeBoolean(false);
return;
}
out.writeBoolean(true);
if (!(member instanceof Method || member instanceof Constructor))
... | [
"private",
"static",
"void",
"writeMember",
"(",
"ObjectOutputStream",
"out",
",",
"Executable",
"member",
")",
"throws",
"IOException",
"{",
"if",
"(",
"member",
"==",
"null",
")",
"{",
"out",
".",
"writeBoolean",
"(",
"false",
")",
";",
"return",
";",
"}... | Writes a Constructor or Method object.
Methods and Constructors are not serializable, so we must serialize
information about the class, the name, and the parameters and
recreate upon deserialization. | [
"Writes",
"a",
"Constructor",
"or",
"Method",
"object",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/MemberBox.java#L227-L241 |
agmip/agmip-common-functions | src/main/java/org/agmip/functions/SoilHelper.java | SoilHelper.getGrowthFactor | protected static String getGrowthFactor(String mid, String pp, String k, String m) {
"""
soil factors which decline exponentially between PP and RD (units depend
on variable, same units as M (Maximum value, will use default value 1)
@param mid The mid point value between two layers
@param pp depth of top soil... | java | protected static String getGrowthFactor(String mid, String pp, String k, String m) {
if (compare(mid, pp, CompareMode.NOTGREATER)) {
return m;
} else {
return multiply(m, exp(multiply(k, substract(mid, pp))));
}
} | [
"protected",
"static",
"String",
"getGrowthFactor",
"(",
"String",
"mid",
",",
"String",
"pp",
",",
"String",
"k",
",",
"String",
"m",
")",
"{",
"if",
"(",
"compare",
"(",
"mid",
",",
"pp",
",",
"CompareMode",
".",
"NOTGREATER",
")",
")",
"{",
"return"... | soil factors which decline exponentially between PP and RD (units depend
on variable, same units as M (Maximum value, will use default value 1)
@param mid The mid point value between two layers
@param pp depth of top soil, or pivot point of curve (cm)
@param k exponential decay rate
@param m Maximum value in the top P... | [
"soil",
"factors",
"which",
"decline",
"exponentially",
"between",
"PP",
"and",
"RD",
"(",
"units",
"depend",
"on",
"variable",
"same",
"units",
"as",
"M",
"(",
"Maximum",
"value",
"will",
"use",
"default",
"value",
"1",
")"
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/functions/SoilHelper.java#L150-L156 |
SnappyDataInc/snappydata | core/src/main/java/io/snappydata/util/com/clearspring/analytics/stream/membership/BloomCalculations.java | BloomCalculations.getFalsePositiveProbability | public static double getFalsePositiveProbability(int bucketsPerElement, int hashCount) {
"""
Calculate the probability of a false positive given the specified
number of inserted elements.
@param bucketsPerElement number of inserted elements.
@param hashCount
@return probability of a false positive.
"""
... | java | public static double getFalsePositiveProbability(int bucketsPerElement, int hashCount) {
// (1 - e^(-k * n / m)) ^ k
return Math.pow(1 - Math.exp(-hashCount * (1 / (double) bucketsPerElement)), hashCount);
} | [
"public",
"static",
"double",
"getFalsePositiveProbability",
"(",
"int",
"bucketsPerElement",
",",
"int",
"hashCount",
")",
"{",
"// (1 - e^(-k * n / m)) ^ k",
"return",
"Math",
".",
"pow",
"(",
"1",
"-",
"Math",
".",
"exp",
"(",
"-",
"hashCount",
"*",
"(",
"1... | Calculate the probability of a false positive given the specified
number of inserted elements.
@param bucketsPerElement number of inserted elements.
@param hashCount
@return probability of a false positive. | [
"Calculate",
"the",
"probability",
"of",
"a",
"false",
"positive",
"given",
"the",
"specified",
"number",
"of",
"inserted",
"elements",
"."
] | train | https://github.com/SnappyDataInc/snappydata/blob/96fe3e37e9f8d407ab68ef9e394083960acad21d/core/src/main/java/io/snappydata/util/com/clearspring/analytics/stream/membership/BloomCalculations.java#L147-L151 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLAnnotationUtil.java | SARLAnnotationUtil.findAnnotation | @SuppressWarnings("static-method")
public JvmAnnotationReference findAnnotation(JvmAnnotationTarget annotationTarget, String lookupType) {
"""
Find an annotation.
@param annotationTarget the annotation target.
@param lookupType the name of the type to look for.
@return the annotation or {@code null}.
@see A... | java | @SuppressWarnings("static-method")
public JvmAnnotationReference findAnnotation(JvmAnnotationTarget annotationTarget, String lookupType) {
// avoid creating an empty list for all given targets but check for #eIsSet first
if (annotationTarget.eIsSet(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS)) {
fo... | [
"@",
"SuppressWarnings",
"(",
"\"static-method\"",
")",
"public",
"JvmAnnotationReference",
"findAnnotation",
"(",
"JvmAnnotationTarget",
"annotationTarget",
",",
"String",
"lookupType",
")",
"{",
"// avoid creating an empty list for all given targets but check for #eIsSet first",
... | Find an annotation.
@param annotationTarget the annotation target.
@param lookupType the name of the type to look for.
@return the annotation or {@code null}.
@see AnnotationLookup#findAnnotation(JvmAnnotationTarget, Class) | [
"Find",
"an",
"annotation",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLAnnotationUtil.java#L251-L263 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/JobsInner.java | JobsInner.createAsync | public Observable<JobInner> createAsync(String resourceGroupName, String jobName, JobCreateParameters parameters) {
"""
Adds a Job that gets executed on a cluster.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param jobName The name of the job within the specified resource... | java | public Observable<JobInner> createAsync(String resourceGroupName, String jobName, JobCreateParameters parameters) {
return createWithServiceResponseAsync(resourceGroupName, jobName, parameters).map(new Func1<ServiceResponse<JobInner>, JobInner>() {
@Override
public JobInner call(ServiceR... | [
"public",
"Observable",
"<",
"JobInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"JobCreateParameters",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"jobName",
",",
"p... | Adds a Job that gets executed on a cluster.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param jobName The name of the job within the specified resource group. Job names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name mus... | [
"Adds",
"a",
"Job",
"that",
"gets",
"executed",
"on",
"a",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/JobsInner.java#L172-L179 |
haraldk/TwelveMonkeys | common/common-io/src/main/java/com/twelvemonkeys/xml/XMLSerializer.java | XMLSerializer.maybeEscapeElementValue | static String maybeEscapeElementValue(final String pValue) {
"""
Returns an escaped version of the input string. The string is guaranteed
to not contain illegal XML characters ({@code &<>}).
If no escaping is needed, the input string is returned as is.
@param pValue the input string that might need escaping.
... | java | static String maybeEscapeElementValue(final String pValue) {
int startEscape = needsEscapeElement(pValue);
if (startEscape < 0) {
// If no escaping is needed, simply return original
return pValue;
}
else {
// Otherwise, start replacing
Str... | [
"static",
"String",
"maybeEscapeElementValue",
"(",
"final",
"String",
"pValue",
")",
"{",
"int",
"startEscape",
"=",
"needsEscapeElement",
"(",
"pValue",
")",
";",
"if",
"(",
"startEscape",
"<",
"0",
")",
"{",
"// If no escaping is needed, simply return original",
... | Returns an escaped version of the input string. The string is guaranteed
to not contain illegal XML characters ({@code &<>}).
If no escaping is needed, the input string is returned as is.
@param pValue the input string that might need escaping.
@return an escaped version of the input string. | [
"Returns",
"an",
"escaped",
"version",
"of",
"the",
"input",
"string",
".",
"The",
"string",
"is",
"guaranteed",
"to",
"not",
"contain",
"illegal",
"XML",
"characters",
"(",
"{",
"@code",
"&<",
">",
"}",
")",
".",
"If",
"no",
"escaping",
"is",
"needed",
... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-io/src/main/java/com/twelvemonkeys/xml/XMLSerializer.java#L256-L290 |
spring-projects/spring-social | spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java | ConnectController.connectionStatus | @RequestMapping(value="/ {
"""
Render the status of the connections to the service provider to the user as HTML in their web browser.
@param providerId the ID of the provider to show connection status
@param request the request
@param model the model
@return the view name of the connection status page for all ... | java | @RequestMapping(value="/{providerId}", method=RequestMethod.GET)
public String connectionStatus(@PathVariable String providerId, NativeWebRequest request, Model model) {
setNoCache(request);
processFlash(request, model);
List<Connection<?>> connections = connectionRepository.findConnections(providerId);
setNoC... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/{providerId}\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"String",
"connectionStatus",
"(",
"@",
"PathVariable",
"String",
"providerId",
",",
"NativeWebRequest",
"request",
",",
"Model",
"model"... | Render the status of the connections to the service provider to the user as HTML in their web browser.
@param providerId the ID of the provider to show connection status
@param request the request
@param model the model
@return the view name of the connection status page for all providers | [
"Render",
"the",
"status",
"of",
"the",
"connections",
"to",
"the",
"service",
"provider",
"to",
"the",
"user",
"as",
"HTML",
"in",
"their",
"web",
"browser",
"."
] | train | https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-web/src/main/java/org/springframework/social/connect/web/ConnectController.java#L222-L234 |
httpcache4j/httpcache4j | httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/DirectivesParser.java | DirectivesParser.createDirective | private Directive createDirective(
final String name,
final String value,
final List<Parameter> params) {
"""
Creates a header element.
Called from {@link #parseDirective}.
@return a header element representing the argument
"""
if (isQuoted(value)) {
... | java | private Directive createDirective(
final String name,
final String value,
final List<Parameter> params) {
if (isQuoted(value)) {
return new QuotedDirective(name, value, params);
}
if (HeaderConstants.LINK_HEADER.equals(name)) {
return n... | [
"private",
"Directive",
"createDirective",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
",",
"final",
"List",
"<",
"Parameter",
">",
"params",
")",
"{",
"if",
"(",
"isQuoted",
"(",
"value",
")",
")",
"{",
"return",
"new",
"QuotedDirecti... | Creates a header element.
Called from {@link #parseDirective}.
@return a header element representing the argument | [
"Creates",
"a",
"header",
"element",
".",
"Called",
"from",
"{",
"@link",
"#parseDirective",
"}",
"."
] | train | https://github.com/httpcache4j/httpcache4j/blob/9c07ebd63cd104a99eb9e771f760f14efa4fe0f6/httpcache4j-api/src/main/java/org/codehaus/httpcache4j/util/DirectivesParser.java#L95-L106 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java | JDBC4PreparedStatement.setDouble | @Override
public void setDouble(int parameterIndex, double x) throws SQLException {
"""
Sets the designated parameter to the given Java double value.
"""
checkParameterBounds(parameterIndex);
this.parameters[parameterIndex-1] = x;
} | java | @Override
public void setDouble(int parameterIndex, double x) throws SQLException
{
checkParameterBounds(parameterIndex);
this.parameters[parameterIndex-1] = x;
} | [
"@",
"Override",
"public",
"void",
"setDouble",
"(",
"int",
"parameterIndex",
",",
"double",
"x",
")",
"throws",
"SQLException",
"{",
"checkParameterBounds",
"(",
"parameterIndex",
")",
";",
"this",
".",
"parameters",
"[",
"parameterIndex",
"-",
"1",
"]",
"=",... | Sets the designated parameter to the given Java double value. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"Java",
"double",
"value",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L334-L339 |
hawkular/hawkular-apm | server/processors-zipkin/src/main/java/org/hawkular/apm/server/processor/zipkin/CompletionTimeUtil.java | CompletionTimeUtil.spanToCompletionTime | public static CompletionTime spanToCompletionTime(SpanCache spanCache, Span span) {
"""
Convert span to CompletionTime object
@param span the span
@param spanCache span cache
@return completion time derived from the supplied span, if the uri of the completion time
cannot be derived (span is server span and c... | java | public static CompletionTime spanToCompletionTime(SpanCache spanCache, Span span) {
CompletionTime completionTime = new CompletionTime();
completionTime.setId(span.getId());
if (span.getTimestamp() != null) {
completionTime.setTimestamp(span.getTimestamp());
}
if (sp... | [
"public",
"static",
"CompletionTime",
"spanToCompletionTime",
"(",
"SpanCache",
"spanCache",
",",
"Span",
"span",
")",
"{",
"CompletionTime",
"completionTime",
"=",
"new",
"CompletionTime",
"(",
")",
";",
"completionTime",
".",
"setId",
"(",
"span",
".",
"getId",
... | Convert span to CompletionTime object
@param span the span
@param spanCache span cache
@return completion time derived from the supplied span, if the uri of the completion time
cannot be derived (span is server span and client span also does not contain url) it returns null | [
"Convert",
"span",
"to",
"CompletionTime",
"object"
] | train | https://github.com/hawkular/hawkular-apm/blob/57a4df0611b359597626563ea5f9ac64d4bb2533/server/processors-zipkin/src/main/java/org/hawkular/apm/server/processor/zipkin/CompletionTimeUtil.java#L46-L83 |
jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/util/Properties.java | Properties.getInt | public Integer getInt(String name, Integer def) {
"""
Returns the property assuming its an int. If it isn't or if its not
defined, returns default value
@param name Property name
@param def Default value
@return Property value or def
"""
final String s = getProperty(name);
try {
... | java | public Integer getInt(String name, Integer def) {
final String s = getProperty(name);
try {
return Integer.parseInt(s);
} catch (Exception e) {
return def;
}
} | [
"public",
"Integer",
"getInt",
"(",
"String",
"name",
",",
"Integer",
"def",
")",
"{",
"final",
"String",
"s",
"=",
"getProperty",
"(",
"name",
")",
";",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"s",
")",
";",
"}",
"catch",
"(",
"Except... | Returns the property assuming its an int. If it isn't or if its not
defined, returns default value
@param name Property name
@param def Default value
@return Property value or def | [
"Returns",
"the",
"property",
"assuming",
"its",
"an",
"int",
".",
"If",
"it",
"isn",
"t",
"or",
"if",
"its",
"not",
"defined",
"returns",
"default",
"value"
] | train | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/util/Properties.java#L48-L55 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java | RefinePolyLineCorner.optimize | protected int optimize( List<Point2D_I32> contour , int c0,int c1,int c2 ) {
"""
Searches around the current c1 point for the best place to put the corner
@return location of best corner in local search region
"""
double bestDistance = computeCost(contour,c0,c1,c2,0);
int bestIndex = 0;
for( int i = ... | java | protected int optimize( List<Point2D_I32> contour , int c0,int c1,int c2 ) {
double bestDistance = computeCost(contour,c0,c1,c2,0);
int bestIndex = 0;
for( int i = -searchRadius; i <= searchRadius; i++ ) {
if( i == 0 ) {
// if it found a better point in the first half stop the search since that's probably... | [
"protected",
"int",
"optimize",
"(",
"List",
"<",
"Point2D_I32",
">",
"contour",
",",
"int",
"c0",
",",
"int",
"c1",
",",
"int",
"c2",
")",
"{",
"double",
"bestDistance",
"=",
"computeCost",
"(",
"contour",
",",
"c0",
",",
"c1",
",",
"c2",
",",
"0",
... | Searches around the current c1 point for the best place to put the corner
@return location of best corner in local search region | [
"Searches",
"around",
"the",
"current",
"c1",
"point",
"for",
"the",
"best",
"place",
"to",
"put",
"the",
"corner"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/RefinePolyLineCorner.java#L133-L152 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/Util.java | Util.quickRatio | public static double quickRatio(final String paramFirst, final String paramSecond) {
"""
Calculates the similarity of two strings. This is done by comparing the
frequency each character occures in both strings.
@param paramFirst
first string
@param paramSecond
second string
@return similarity of a and b, a... | java | public static double quickRatio(final String paramFirst, final String paramSecond) {
if (paramFirst == null || paramSecond == null) {
return 1;
}
double matches = 0;
// Use a sparse array to reduce the memory usage
// for unicode characters.
final int x[][] =... | [
"public",
"static",
"double",
"quickRatio",
"(",
"final",
"String",
"paramFirst",
",",
"final",
"String",
"paramSecond",
")",
"{",
"if",
"(",
"paramFirst",
"==",
"null",
"||",
"paramSecond",
"==",
"null",
")",
"{",
"return",
"1",
";",
"}",
"double",
"match... | Calculates the similarity of two strings. This is done by comparing the
frequency each character occures in both strings.
@param paramFirst
first string
@param paramSecond
second string
@return similarity of a and b, a value in [0, 1] | [
"Calculates",
"the",
"similarity",
"of",
"two",
"strings",
".",
"This",
"is",
"done",
"by",
"comparing",
"the",
"frequency",
"each",
"character",
"occures",
"in",
"both",
"strings",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/Util.java#L119-L143 |
alkacon/opencms-core | src/org/opencms/security/CmsDefaultAuthorizationHandler.java | CmsDefaultAuthorizationHandler.requestAuthorization | public void requestAuthorization(HttpServletRequest req, HttpServletResponse res, String loginFormURL)
throws IOException {
"""
This method sends a request to the client to display a login form,
it is needed for HTTP-Authentication.<p>
@param req the client request
@param res the response
@param loginFor... | java | public void requestAuthorization(HttpServletRequest req, HttpServletResponse res, String loginFormURL)
throws IOException {
CmsHttpAuthenticationSettings httpAuthenticationSettings = OpenCms.getSystemInfo().getHttpAuthenticationSettings();
if (loginFormURL == null) {
if (httpAuthentica... | [
"public",
"void",
"requestAuthorization",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"String",
"loginFormURL",
")",
"throws",
"IOException",
"{",
"CmsHttpAuthenticationSettings",
"httpAuthenticationSettings",
"=",
"OpenCms",
".",
"getSystemInf... | This method sends a request to the client to display a login form,
it is needed for HTTP-Authentication.<p>
@param req the client request
@param res the response
@param loginFormURL the full URL used for form based authentication
@throws IOException if something goes wrong | [
"This",
"method",
"sends",
"a",
"request",
"to",
"the",
"client",
"to",
"display",
"a",
"login",
"form",
"it",
"is",
"needed",
"for",
"HTTP",
"-",
"Authentication",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsDefaultAuthorizationHandler.java#L144-L179 |
jenkinsci/favorite-plugin | src/main/java/hudson/plugins/favorite/Favorites.java | Favorites.addFavorite | public static void addFavorite(@Nonnull User user, @Nonnull Item item) throws FavoriteException {
"""
Add an item as a favorite for a user
Fires {@link FavoriteListener#fireOnAddFavourite(Item, User)}
@param user to add the favorite to
@param item to favorite
@throws FavoriteException
"""
try {
... | java | public static void addFavorite(@Nonnull User user, @Nonnull Item item) throws FavoriteException {
try {
if (!isFavorite(user, item)) {
FavoriteUserProperty property = getProperty(user);
property.addFavorite(item.getFullName());
FavoriteListener.fireOnA... | [
"public",
"static",
"void",
"addFavorite",
"(",
"@",
"Nonnull",
"User",
"user",
",",
"@",
"Nonnull",
"Item",
"item",
")",
"throws",
"FavoriteException",
"{",
"try",
"{",
"if",
"(",
"!",
"isFavorite",
"(",
"user",
",",
"item",
")",
")",
"{",
"FavoriteUser... | Add an item as a favorite for a user
Fires {@link FavoriteListener#fireOnAddFavourite(Item, User)}
@param user to add the favorite to
@param item to favorite
@throws FavoriteException | [
"Add",
"an",
"item",
"as",
"a",
"favorite",
"for",
"a",
"user",
"Fires",
"{"
] | train | https://github.com/jenkinsci/favorite-plugin/blob/4ce9b195b4d888190fe12c92d546d64f22728c22/src/main/java/hudson/plugins/favorite/Favorites.java#L72-L84 |
czyzby/gdx-lml | mvc/src/main/java/com/github/czyzby/autumn/mvc/component/asset/AssetService.java | AssetService.finishLoading | public <Type> Type finishLoading(final String assetPath, final Class<Type> assetClass) {
"""
Immediately loads the chosen asset. Schedules loading of the asset if it wasn't selected to be loaded already.
@param assetPath internal path to the asset.
@param assetClass class of the loaded asset.
@return instance... | java | public <Type> Type finishLoading(final String assetPath, final Class<Type> assetClass) {
return finishLoading(assetPath, assetClass, null);
} | [
"public",
"<",
"Type",
">",
"Type",
"finishLoading",
"(",
"final",
"String",
"assetPath",
",",
"final",
"Class",
"<",
"Type",
">",
"assetClass",
")",
"{",
"return",
"finishLoading",
"(",
"assetPath",
",",
"assetClass",
",",
"null",
")",
";",
"}"
] | Immediately loads the chosen asset. Schedules loading of the asset if it wasn't selected to be loaded already.
@param assetPath internal path to the asset.
@param assetClass class of the loaded asset.
@return instance of the loaded asset.
@param <Type> type of asset class to load. | [
"Immediately",
"loads",
"the",
"chosen",
"asset",
".",
"Schedules",
"loading",
"of",
"the",
"asset",
"if",
"it",
"wasn",
"t",
"selected",
"to",
"be",
"loaded",
"already",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/mvc/src/main/java/com/github/czyzby/autumn/mvc/component/asset/AssetService.java#L147-L149 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java | ModelScanner.pullAnnotation | static <T extends Annotation> T pullAnnotation(AnnotatedElement theTarget, Class<T> theAnnotationType) {
"""
There are two implementations of all of the annotations (e.g. {@link Child} since the HL7.org ones will eventually replace the HAPI
ones. Annotations can't extend each other or implement interfaces or anyt... | java | static <T extends Annotation> T pullAnnotation(AnnotatedElement theTarget, Class<T> theAnnotationType) {
T retVal = theTarget.getAnnotation(theAnnotationType);
return retVal;
} | [
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"pullAnnotation",
"(",
"AnnotatedElement",
"theTarget",
",",
"Class",
"<",
"T",
">",
"theAnnotationType",
")",
"{",
"T",
"retVal",
"=",
"theTarget",
".",
"getAnnotation",
"(",
"theAnnotationType",
")",
";"... | There are two implementations of all of the annotations (e.g. {@link Child} since the HL7.org ones will eventually replace the HAPI
ones. Annotations can't extend each other or implement interfaces or anything like that, so rather than duplicate all of the annotation processing code this method just creates an interfac... | [
"There",
"are",
"two",
"implementations",
"of",
"all",
"of",
"the",
"annotations",
"(",
"e",
".",
"g",
".",
"{"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java#L463-L466 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseByteObj | @Nullable
public static Byte parseByteObj (@Nullable final Object aObject, @Nullable final Byte aDefault) {
"""
Parse the given {@link Object} as {@link Byte} with radix
{@value #DEFAULT_RADIX}.
@param aObject
The object to parse. May be <code>null</code>.
@param aDefault
The default value to be returned,... | java | @Nullable
public static Byte parseByteObj (@Nullable final Object aObject, @Nullable final Byte aDefault)
{
return parseByteObj (aObject, DEFAULT_RADIX, aDefault);
} | [
"@",
"Nullable",
"public",
"static",
"Byte",
"parseByteObj",
"(",
"@",
"Nullable",
"final",
"Object",
"aObject",
",",
"@",
"Nullable",
"final",
"Byte",
"aDefault",
")",
"{",
"return",
"parseByteObj",
"(",
"aObject",
",",
"DEFAULT_RADIX",
",",
"aDefault",
")",
... | Parse the given {@link Object} as {@link Byte} with radix
{@value #DEFAULT_RADIX}.
@param aObject
The object to parse. May be <code>null</code>.
@param aDefault
The default value to be returned, if the passed object cannot be
converted. May be <code>null</code>.
@return the passed default value if the object does not ... | [
"Parse",
"the",
"given",
"{",
"@link",
"Object",
"}",
"as",
"{",
"@link",
"Byte",
"}",
"with",
"radix",
"{",
"@value",
"#DEFAULT_RADIX",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L356-L360 |
landawn/AbacusUtil | src/com/landawn/abacus/util/FilenameUtil.java | FilenameUtil.wildcardMatch | public static boolean wildcardMatch(final String filename, final String wildcardfilter) {
"""
Checks a filename to see if it matches the specified wildcard filter,
always testing case-sensitive.
<p>
The wildcard filter uses the characters '?' and '*' to represent a
single or multiple (zero or more) wildcard ch... | java | public static boolean wildcardMatch(final String filename, final String wildcardfilter) {
return wildcardMatch(filename, wildcardfilter, IOCase.SENSITIVE);
} | [
"public",
"static",
"boolean",
"wildcardMatch",
"(",
"final",
"String",
"filename",
",",
"final",
"String",
"wildcardfilter",
")",
"{",
"return",
"wildcardMatch",
"(",
"filename",
",",
"wildcardfilter",
",",
"IOCase",
".",
"SENSITIVE",
")",
";",
"}"
] | Checks a filename to see if it matches the specified wildcard filter,
always testing case-sensitive.
<p>
The wildcard filter uses the characters '?' and '*' to represent a
single or multiple (zero or more) wildcard characters.
This is the same as often found on Dos/Unix command lines.
The check is case-sensitive always... | [
"Checks",
"a",
"filename",
"to",
"see",
"if",
"it",
"matches",
"the",
"specified",
"wildcard",
"filter",
"always",
"testing",
"case",
"-",
"sensitive",
".",
"<p",
">",
"The",
"wildcard",
"filter",
"uses",
"the",
"characters",
"?",
"and",
"*",
"to",
"repres... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/FilenameUtil.java#L1256-L1258 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDateTimeUtil.java | CmsDateTimeUtil.getDate | public static String getDate(Date date, Format format) {
"""
Returns a formated date String from a Date value,
the formatting based on the provided options.<p>
@param date the Date object to format as String
@param format the format to use
@return the formatted date
"""
DateTimeFormat df;
... | java | public static String getDate(Date date, Format format) {
DateTimeFormat df;
switch (format) {
case FULL:
df = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_FULL);
break;
case LONG:
df = DateTimeFormat.getFormat(Date... | [
"public",
"static",
"String",
"getDate",
"(",
"Date",
"date",
",",
"Format",
"format",
")",
"{",
"DateTimeFormat",
"df",
";",
"switch",
"(",
"format",
")",
"{",
"case",
"FULL",
":",
"df",
"=",
"DateTimeFormat",
".",
"getFormat",
"(",
"DateTimeFormat",
".",... | Returns a formated date String from a Date value,
the formatting based on the provided options.<p>
@param date the Date object to format as String
@param format the format to use
@return the formatted date | [
"Returns",
"a",
"formated",
"date",
"String",
"from",
"a",
"Date",
"value",
"the",
"formatting",
"based",
"on",
"the",
"provided",
"options",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDateTimeUtil.java#L80-L101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.