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 |
|---|---|---|---|---|---|---|---|---|---|---|
classgraph/classgraph | src/main/java/io/github/classgraph/ClassGraphException.java | ClassGraphException.newClassGraphException | public static ClassGraphException newClassGraphException(final String message, final Throwable cause)
throws ClassGraphException {
"""
Static factory method to stop IDEs from auto-completing ClassGraphException after "new ClassGraph".
@param message
the message
@param cause
the cause
@return the... | java | public static ClassGraphException newClassGraphException(final String message, final Throwable cause)
throws ClassGraphException {
return new ClassGraphException(message, cause);
} | [
"public",
"static",
"ClassGraphException",
"newClassGraphException",
"(",
"final",
"String",
"message",
",",
"final",
"Throwable",
"cause",
")",
"throws",
"ClassGraphException",
"{",
"return",
"new",
"ClassGraphException",
"(",
"message",
",",
"cause",
")",
";",
"}"... | Static factory method to stop IDEs from auto-completing ClassGraphException after "new ClassGraph".
@param message
the message
@param cause
the cause
@return the ClassGraphException
@throws ClassGraphException
the class graph exception | [
"Static",
"factory",
"method",
"to",
"stop",
"IDEs",
"from",
"auto",
"-",
"completing",
"ClassGraphException",
"after",
"new",
"ClassGraph",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassGraphException.java#L87-L90 |
SonarSource/sonarqube | server/sonar-process/src/main/java/org/sonar/process/logging/AbstractLogHelper.java | AbstractLogHelper.resolveLevel | static Level resolveLevel(Props props, String... propertyKeys) {
"""
Resolve a log level reading the value of specified properties.
<p>
To compute the applied log level the following rules will be followed:
<ul>the last property with a defined and valid value in the order of the {@code propertyKeys} argument wi... | java | static Level resolveLevel(Props props, String... propertyKeys) {
Level newLevel = Level.INFO;
for (String propertyKey : propertyKeys) {
Level level = getPropertyValueAsLevel(props, propertyKey);
if (level != null) {
newLevel = level;
}
}
return newLevel;
} | [
"static",
"Level",
"resolveLevel",
"(",
"Props",
"props",
",",
"String",
"...",
"propertyKeys",
")",
"{",
"Level",
"newLevel",
"=",
"Level",
".",
"INFO",
";",
"for",
"(",
"String",
"propertyKey",
":",
"propertyKeys",
")",
"{",
"Level",
"level",
"=",
"getPr... | Resolve a log level reading the value of specified properties.
<p>
To compute the applied log level the following rules will be followed:
<ul>the last property with a defined and valid value in the order of the {@code propertyKeys} argument will be applied</ul>
<ul>if there is none, {@link Level#INFO INFO} will be retu... | [
"Resolve",
"a",
"log",
"level",
"reading",
"the",
"value",
"of",
"specified",
"properties",
".",
"<p",
">",
"To",
"compute",
"the",
"applied",
"log",
"level",
"the",
"following",
"rules",
"will",
"be",
"followed",
":",
"<ul",
">",
"the",
"last",
"property"... | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-process/src/main/java/org/sonar/process/logging/AbstractLogHelper.java#L64-L73 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/message/analytics/RawAnalyticsRequest.java | RawAnalyticsRequest.jsonQuery | public static RawAnalyticsRequest jsonQuery(String jsonQuery, String bucket, String password) {
"""
Create a {@link RawAnalyticsRequest} containing a full Analytics query in Json form (including additional
query parameters).
The simplest form of such a query is a single statement encapsulated in a json query o... | java | public static RawAnalyticsRequest jsonQuery(String jsonQuery, String bucket, String password) {
return new RawAnalyticsRequest(jsonQuery, bucket, bucket, password, null, GenericAnalyticsRequest.NO_PRIORITY);
} | [
"public",
"static",
"RawAnalyticsRequest",
"jsonQuery",
"(",
"String",
"jsonQuery",
",",
"String",
"bucket",
",",
"String",
"password",
")",
"{",
"return",
"new",
"RawAnalyticsRequest",
"(",
"jsonQuery",
",",
"bucket",
",",
"bucket",
",",
"password",
",",
"null"... | Create a {@link RawAnalyticsRequest} containing a full Analytics query in Json form (including additional
query parameters).
The simplest form of such a query is a single statement encapsulated in a json query object:
<pre>{"statement":"SELECT * FROM default"}</pre>.
@param jsonQuery the Analytics query in json form.... | [
"Create",
"a",
"{",
"@link",
"RawAnalyticsRequest",
"}",
"containing",
"a",
"full",
"Analytics",
"query",
"in",
"Json",
"form",
"(",
"including",
"additional",
"query",
"parameters",
")",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/message/analytics/RawAnalyticsRequest.java#L53-L55 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java | TouchActions.longPress | public TouchActions longPress(WebElement onElement) {
"""
Allows the execution of long press gestures.
@param onElement The {@link WebElement} to long press
@return self
"""
if (touchScreen != null) {
action.addAction(new LongPressAction(touchScreen, (Locatable) onElement));
}
return this... | java | public TouchActions longPress(WebElement onElement) {
if (touchScreen != null) {
action.addAction(new LongPressAction(touchScreen, (Locatable) onElement));
}
return this;
} | [
"public",
"TouchActions",
"longPress",
"(",
"WebElement",
"onElement",
")",
"{",
"if",
"(",
"touchScreen",
"!=",
"null",
")",
"{",
"action",
".",
"addAction",
"(",
"new",
"LongPressAction",
"(",
"touchScreen",
",",
"(",
"Locatable",
")",
"onElement",
")",
")... | Allows the execution of long press gestures.
@param onElement The {@link WebElement} to long press
@return self | [
"Allows",
"the",
"execution",
"of",
"long",
"press",
"gestures",
"."
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/interactions/touch/TouchActions.java#L143-L148 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseHeaderValidation | private void parseHeaderValidation(Map<Object, Object> props) {
"""
Parse the configuration on whether to perform header validation or not.
@param props
"""
Object value = props.get(HttpConfigConstants.PROPNAME_HEADER_VALIDATION);
if (null != value) {
this.bHeaderValidation = con... | java | private void parseHeaderValidation(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_HEADER_VALIDATION);
if (null != value) {
this.bHeaderValidation = convertBoolean(value);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
... | [
"private",
"void",
"parseHeaderValidation",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_HEADER_VALIDATION",
")",
";",
"if",
"(",
"null",
"!=",
"valu... | Parse the configuration on whether to perform header validation or not.
@param props | [
"Parse",
"the",
"configuration",
"on",
"whether",
"to",
"perform",
"header",
"validation",
"or",
"not",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L1013-L1021 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdClient.java | MessageBirdClient.deleteGroupContact | public void deleteGroupContact(final String groupId, final String contactId) throws NotFoundException, GeneralException, UnauthorizedException {
"""
Removes a contact from group. You need to supply the IDs of the group
and contact. Does not delete the contact.
"""
if (groupId == null) {
th... | java | public void deleteGroupContact(final String groupId, final String contactId) throws NotFoundException, GeneralException, UnauthorizedException {
if (groupId == null) {
throw new IllegalArgumentException("Group ID must be specified.");
}
if (contactId == null) {
throw new ... | [
"public",
"void",
"deleteGroupContact",
"(",
"final",
"String",
"groupId",
",",
"final",
"String",
"contactId",
")",
"throws",
"NotFoundException",
",",
"GeneralException",
",",
"UnauthorizedException",
"{",
"if",
"(",
"groupId",
"==",
"null",
")",
"{",
"throw",
... | Removes a contact from group. You need to supply the IDs of the group
and contact. Does not delete the contact. | [
"Removes",
"a",
"contact",
"from",
"group",
".",
"You",
"need",
"to",
"supply",
"the",
"IDs",
"of",
"the",
"group",
"and",
"contact",
".",
"Does",
"not",
"delete",
"the",
"contact",
"."
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L613-L623 |
apache/incubator-gobblin | gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/MRCompactorJobRunner.java | MRCompactorJobRunner.getCompactionTimestamp | private DateTime getCompactionTimestamp() throws IOException {
"""
For regular compactions, compaction timestamp is the time the compaction job starts.
If this is a recompaction from output paths, the compaction timestamp will remain the same as previously
persisted compaction time. This is because such a reco... | java | private DateTime getCompactionTimestamp() throws IOException {
DateTimeZone timeZone = DateTimeZone.forID(
this.dataset.jobProps().getProp(MRCompactor.COMPACTION_TIMEZONE, MRCompactor.DEFAULT_COMPACTION_TIMEZONE));
if (!this.recompactFromDestPaths) {
return new DateTime(timeZone);
}
Set<... | [
"private",
"DateTime",
"getCompactionTimestamp",
"(",
")",
"throws",
"IOException",
"{",
"DateTimeZone",
"timeZone",
"=",
"DateTimeZone",
".",
"forID",
"(",
"this",
".",
"dataset",
".",
"jobProps",
"(",
")",
".",
"getProp",
"(",
"MRCompactor",
".",
"COMPACTION_T... | For regular compactions, compaction timestamp is the time the compaction job starts.
If this is a recompaction from output paths, the compaction timestamp will remain the same as previously
persisted compaction time. This is because such a recompaction doesn't consume input data, so next time,
whether a file in the in... | [
"For",
"regular",
"compactions",
"compaction",
"timestamp",
"is",
"the",
"time",
"the",
"compaction",
"job",
"starts",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/MRCompactorJobRunner.java#L372-L386 |
chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.pullFontPathFromStyle | static String pullFontPathFromStyle(Context context, AttributeSet attrs, int[] attributeId) {
"""
Tries to pull the Font Path from the View Style as this is the next decendent after being
defined in the View's xml.
@param context Activity Activity Context
@param attrs View Attributes
@param attribu... | java | static String pullFontPathFromStyle(Context context, AttributeSet attrs, int[] attributeId) {
if (attributeId == null || attrs == null)
return null;
final TypedArray typedArray = context.obtainStyledAttributes(attrs, attributeId);
if (typedArray != null) {
try {
... | [
"static",
"String",
"pullFontPathFromStyle",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
",",
"int",
"[",
"]",
"attributeId",
")",
"{",
"if",
"(",
"attributeId",
"==",
"null",
"||",
"attrs",
"==",
"null",
")",
"return",
"null",
";",
"final",
"... | Tries to pull the Font Path from the View Style as this is the next decendent after being
defined in the View's xml.
@param context Activity Activity Context
@param attrs View Attributes
@param attributeId if -1 returns null.
@return null if attribute is not defined or found in the Style | [
"Tries",
"to",
"pull",
"the",
"Font",
"Path",
"from",
"the",
"View",
"Style",
"as",
"this",
"is",
"the",
"next",
"decendent",
"after",
"being",
"defined",
"in",
"the",
"View",
"s",
"xml",
"."
] | train | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L184-L202 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/config/AbstractInterfaceConfig.java | AbstractInterfaceConfig.getMethodConfigValue | public Object getMethodConfigValue(String methodName, String configKey, Object defaultValue) {
"""
得到方法级配置,找不到则返回默认值
@param methodName 方法名
@param configKey 配置key,例如参数
@param defaultValue 默认值
@return 配置值 method config value
"""
Object value = getMethodConfigValue(methodName, configKey);
... | java | public Object getMethodConfigValue(String methodName, String configKey, Object defaultValue) {
Object value = getMethodConfigValue(methodName, configKey);
return value == null ? defaultValue : value;
} | [
"public",
"Object",
"getMethodConfigValue",
"(",
"String",
"methodName",
",",
"String",
"configKey",
",",
"Object",
"defaultValue",
")",
"{",
"Object",
"value",
"=",
"getMethodConfigValue",
"(",
"methodName",
",",
"configKey",
")",
";",
"return",
"value",
"==",
... | 得到方法级配置,找不到则返回默认值
@param methodName 方法名
@param configKey 配置key,例如参数
@param defaultValue 默认值
@return 配置值 method config value | [
"得到方法级配置,找不到则返回默认值"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/config/AbstractInterfaceConfig.java#L946-L949 |
jfoenixadmin/JFoenix | jfoenix/src/main/java/com/jfoenix/svg/SVGGlyphLoader.java | SVGGlyphLoader.getIcoMoonGlyph | public static SVGGlyph getIcoMoonGlyph(String glyphName) throws Exception {
"""
will retrieve icons from the glyphs map for a certain glyphName
@param glyphName the glyph name
@return SVGGlyph node
"""
SVGGlyphBuilder builder = glyphsMap.get(glyphName);
if(builder == null) throw new Excepti... | java | public static SVGGlyph getIcoMoonGlyph(String glyphName) throws Exception{
SVGGlyphBuilder builder = glyphsMap.get(glyphName);
if(builder == null) throw new Exception("Glyph '" + glyphName + "' not found!");
SVGGlyph glyph = builder.build();
// we need to apply transformation to correct ... | [
"public",
"static",
"SVGGlyph",
"getIcoMoonGlyph",
"(",
"String",
"glyphName",
")",
"throws",
"Exception",
"{",
"SVGGlyphBuilder",
"builder",
"=",
"glyphsMap",
".",
"get",
"(",
"glyphName",
")",
";",
"if",
"(",
"builder",
"==",
"null",
")",
"throw",
"new",
"... | will retrieve icons from the glyphs map for a certain glyphName
@param glyphName the glyph name
@return SVGGlyph node | [
"will",
"retrieve",
"icons",
"from",
"the",
"glyphs",
"map",
"for",
"a",
"certain",
"glyphName"
] | train | https://github.com/jfoenixadmin/JFoenix/blob/53235b5f561da4a515ef716059b8a8df5239ffa1/jfoenix/src/main/java/com/jfoenix/svg/SVGGlyphLoader.java#L65-L76 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.printToFileLn | public static void printToFileLn(String filename, String message, boolean append) {
"""
Prints to a file. If the file already exists, appends if
<code>append=true</code>, and overwrites if <code>append=false</code>
"""
printToFileLn(new File(filename), message, append);
} | java | public static void printToFileLn(String filename, String message, boolean append) {
printToFileLn(new File(filename), message, append);
} | [
"public",
"static",
"void",
"printToFileLn",
"(",
"String",
"filename",
",",
"String",
"message",
",",
"boolean",
"append",
")",
"{",
"printToFileLn",
"(",
"new",
"File",
"(",
"filename",
")",
",",
"message",
",",
"append",
")",
";",
"}"
] | Prints to a file. If the file already exists, appends if
<code>append=true</code>, and overwrites if <code>append=false</code> | [
"Prints",
"to",
"a",
"file",
".",
"If",
"the",
"file",
"already",
"exists",
"appends",
"if",
"<code",
">",
"append",
"=",
"true<",
"/",
"code",
">",
"and",
"overwrites",
"if",
"<code",
">",
"append",
"=",
"false<",
"/",
"code",
">"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L968-L970 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/NativeQuery.java | NativeQuery.withResultSetAsyncListeners | public NativeQuery withResultSetAsyncListeners(List<Function<ResultSet, ResultSet>> resultSetAsyncListeners) {
"""
Add the given list of async listeners on the {@link com.datastax.driver.core.ResultSet} object.
Example of usage:
<pre class="code"><code class="java">
.withResultSetAsyncListeners(Arrays.asList(... | java | public NativeQuery withResultSetAsyncListeners(List<Function<ResultSet, ResultSet>> resultSetAsyncListeners) {
this.options.setResultSetAsyncListeners(Optional.of(resultSetAsyncListeners));
return this;
} | [
"public",
"NativeQuery",
"withResultSetAsyncListeners",
"(",
"List",
"<",
"Function",
"<",
"ResultSet",
",",
"ResultSet",
">",
">",
"resultSetAsyncListeners",
")",
"{",
"this",
".",
"options",
".",
"setResultSetAsyncListeners",
"(",
"Optional",
".",
"of",
"(",
"re... | Add the given list of async listeners on the {@link com.datastax.driver.core.ResultSet} object.
Example of usage:
<pre class="code"><code class="java">
.withResultSetAsyncListeners(Arrays.asList(resultSet -> {
//Do something with the resultSet object here
}))
</code></pre>
Remark: <strong>it is not allowed to consum... | [
"Add",
"the",
"given",
"list",
"of",
"async",
"listeners",
"on",
"the",
"{",
"@link",
"com",
".",
"datastax",
".",
"driver",
".",
"core",
".",
"ResultSet",
"}",
"object",
".",
"Example",
"of",
"usage",
":",
"<pre",
"class",
"=",
"code",
">",
"<code",
... | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/dsl/raw/NativeQuery.java#L126-L129 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java | OperationSupport.assertResponseCode | protected void assertResponseCode(Request request, Response response) {
"""
Checks if the response status code is the expected and throws the appropriate KubernetesClientException if not.
@param request The {#link Request} object.
@param response The {@link Response} object.
@throws Kuber... | java | protected void assertResponseCode(Request request, Response response) {
int statusCode = response.code();
String customMessage = config.getErrorMessages().get(statusCode);
if (response.isSuccessful()) {
return;
} else if (customMessage != null) {
throw requestFailure(request, createStatus(s... | [
"protected",
"void",
"assertResponseCode",
"(",
"Request",
"request",
",",
"Response",
"response",
")",
"{",
"int",
"statusCode",
"=",
"response",
".",
"code",
"(",
")",
";",
"String",
"customMessage",
"=",
"config",
".",
"getErrorMessages",
"(",
")",
".",
"... | Checks if the response status code is the expected and throws the appropriate KubernetesClientException if not.
@param request The {#link Request} object.
@param response The {@link Response} object.
@throws KubernetesClientException When the response code is not the expected. | [
"Checks",
"if",
"the",
"response",
"status",
"code",
"is",
"the",
"expected",
"and",
"throws",
"the",
"appropriate",
"KubernetesClientException",
"if",
"not",
"."
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java#L433-L444 |
google/closure-compiler | src/com/google/javascript/jscomp/CheckGlobalNames.java | CheckGlobalNames.checkDescendantNames | private void checkDescendantNames(Name name, boolean nameIsDefined) {
"""
Checks to make sure all the descendants of a name are defined if they
are referenced.
@param name A global name.
@param nameIsDefined If true, {@code name} is defined. Otherwise, it's
undefined, and any references to descendant names s... | java | private void checkDescendantNames(Name name, boolean nameIsDefined) {
if (name.props != null) {
for (Name prop : name.props) {
// if the ancestor of a property is not defined, then we should emit
// warnings for all references to the property.
boolean propIsDefined = false;
if ... | [
"private",
"void",
"checkDescendantNames",
"(",
"Name",
"name",
",",
"boolean",
"nameIsDefined",
")",
"{",
"if",
"(",
"name",
".",
"props",
"!=",
"null",
")",
"{",
"for",
"(",
"Name",
"prop",
":",
"name",
".",
"props",
")",
"{",
"// if the ancestor of a pr... | Checks to make sure all the descendants of a name are defined if they
are referenced.
@param name A global name.
@param nameIsDefined If true, {@code name} is defined. Otherwise, it's
undefined, and any references to descendant names should emit warnings. | [
"Checks",
"to",
"make",
"sure",
"all",
"the",
"descendants",
"of",
"a",
"name",
"are",
"defined",
"if",
"they",
"are",
"referenced",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckGlobalNames.java#L132-L150 |
Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java | CountedCompleter.nextComplete | public final CountedCompleter<?> nextComplete() {
"""
If this task does not have a completer, invokes {@link ForkJoinTask#quietlyComplete} and
returns {@code null}. Or, if the completer's pending count is non-zero, decrements that pending
count and returns {@code null}. Otherwise, returns the completer. This met... | java | public final CountedCompleter<?> nextComplete() {
CountedCompleter<?> p;
if ((p = completer) != null)
return p.firstComplete();
else {
quietlyComplete();
return null;
}
} | [
"public",
"final",
"CountedCompleter",
"<",
"?",
">",
"nextComplete",
"(",
")",
"{",
"CountedCompleter",
"<",
"?",
">",
"p",
";",
"if",
"(",
"(",
"p",
"=",
"completer",
")",
"!=",
"null",
")",
"return",
"p",
".",
"firstComplete",
"(",
")",
";",
"else... | If this task does not have a completer, invokes {@link ForkJoinTask#quietlyComplete} and
returns {@code null}. Or, if the completer's pending count is non-zero, decrements that pending
count and returns {@code null}. Otherwise, returns the completer. This method can be used as
part of a completion traversal loop for ho... | [
"If",
"this",
"task",
"does",
"not",
"have",
"a",
"completer",
"invokes",
"{",
"@link",
"ForkJoinTask#quietlyComplete",
"}",
"and",
"returns",
"{",
"@code",
"null",
"}",
".",
"Or",
"if",
"the",
"completer",
"s",
"pending",
"count",
"is",
"non",
"-",
"zero"... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java#L639-L647 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.getRelativePath | public static String getRelativePath(final File baseDir, final File dir) {
"""
Returns a relative path based on a base directory. If the <code>dir</code> is not inside <code>baseDir</code> an
<code>IllegalArgumentException</code> is thrown.
@param baseDir
Base directory the path is relative to - Cannot be <co... | java | public static String getRelativePath(final File baseDir, final File dir) {
checkNotNull("baseDir", baseDir);
checkNotNull("dir", dir);
final String base = getCanonicalPath(baseDir);
final String path = getCanonicalPath(dir);
if (!path.startsWith(base)) {
throw... | [
"public",
"static",
"String",
"getRelativePath",
"(",
"final",
"File",
"baseDir",
",",
"final",
"File",
"dir",
")",
"{",
"checkNotNull",
"(",
"\"baseDir\"",
",",
"baseDir",
")",
";",
"checkNotNull",
"(",
"\"dir\"",
",",
"dir",
")",
";",
"final",
"String",
... | Returns a relative path based on a base directory. If the <code>dir</code> is not inside <code>baseDir</code> an
<code>IllegalArgumentException</code> is thrown.
@param baseDir
Base directory the path is relative to - Cannot be <code>null</code>.
@param dir
Directory inside the base directory - Cannot be <code>null</c... | [
"Returns",
"a",
"relative",
"path",
"based",
"on",
"a",
"base",
"directory",
".",
"If",
"the",
"<code",
">",
"dir<",
"/",
"code",
">",
"is",
"not",
"inside",
"<code",
">",
"baseDir<",
"/",
"code",
">",
"an",
"<code",
">",
"IllegalArgumentException<",
"/"... | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L508-L521 |
marklogic/marklogic-contentpump | mlcp/src/main/java/com/marklogic/contentpump/ContentPump.java | ContentPump.setClassLoader | private static void setClassLoader(File hdConfDir, Configuration conf)
throws Exception {
"""
Set class loader for current thread and for Confifguration based on
Hadoop home.
@param hdConfDir Hadoop home directory
@param conf Hadoop configuration
@throws MalformedURLException
"""
ClassLoader... | java | private static void setClassLoader(File hdConfDir, Configuration conf)
throws Exception {
ClassLoader parent = conf.getClassLoader();
URL url = hdConfDir.toURI().toURL();
URL[] urls = new URL[1];
urls[0] = url;
ClassLoader classLoader = new URLClassLoader(urls, parent);
... | [
"private",
"static",
"void",
"setClassLoader",
"(",
"File",
"hdConfDir",
",",
"Configuration",
"conf",
")",
"throws",
"Exception",
"{",
"ClassLoader",
"parent",
"=",
"conf",
".",
"getClassLoader",
"(",
")",
";",
"URL",
"url",
"=",
"hdConfDir",
".",
"toURI",
... | Set class loader for current thread and for Confifguration based on
Hadoop home.
@param hdConfDir Hadoop home directory
@param conf Hadoop configuration
@throws MalformedURLException | [
"Set",
"class",
"loader",
"for",
"current",
"thread",
"and",
"for",
"Confifguration",
"based",
"on",
"Hadoop",
"home",
"."
] | train | https://github.com/marklogic/marklogic-contentpump/blob/4c41e4a953301f81a4c655efb2a847603dee8afc/mlcp/src/main/java/com/marklogic/contentpump/ContentPump.java#L261-L270 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupManager.java | PoolGroupManager.addSession | public void addSession(String id, Session session) {
"""
Add a session to the scheduler
@param id the id of the session
@param session the session object to add
"""
PoolInfo poolInfo = getPoolInfo(session);
LOG.info("Session " + id + " added to pool info " +
poolInfo + " (originally " + sessi... | java | public void addSession(String id, Session session) {
PoolInfo poolInfo = getPoolInfo(session);
LOG.info("Session " + id + " added to pool info " +
poolInfo + " (originally " + session.getInfo().getPoolInfoStrings() +") for " + type);
getPoolSchedulable(poolInfo).addSession(id, session);
} | [
"public",
"void",
"addSession",
"(",
"String",
"id",
",",
"Session",
"session",
")",
"{",
"PoolInfo",
"poolInfo",
"=",
"getPoolInfo",
"(",
"session",
")",
";",
"LOG",
".",
"info",
"(",
"\"Session \"",
"+",
"id",
"+",
"\" added to pool info \"",
"+",
"poolInf... | Add a session to the scheduler
@param id the id of the session
@param session the session object to add | [
"Add",
"a",
"session",
"to",
"the",
"scheduler"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/PoolGroupManager.java#L143-L148 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java | DefaultServletContainerAdapter.login | public void login( String username, String password, HttpServletRequest request, HttpServletResponse response )
throws LoginException {
"""
Log in the user, using "weak" username/password authentication. This default implementation always throws
{@link UnsupportedOperationException}.
@throws Unsup... | java | public void login( String username, String password, HttpServletRequest request, HttpServletResponse response )
throws LoginException
{
throw new UnsupportedOperationException( "login is not supported by "
+ DefaultServletContainerAdapter.class.ge... | [
"public",
"void",
"login",
"(",
"String",
"username",
",",
"String",
"password",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"LoginException",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"login is not sup... | Log in the user, using "weak" username/password authentication. This default implementation always throws
{@link UnsupportedOperationException}.
@throws UnsupportedOperationException in all cases. | [
"Log",
"in",
"the",
"user",
"using",
"weak",
"username",
"/",
"password",
"authentication",
".",
"This",
"default",
"implementation",
"always",
"throws",
"{",
"@link",
"UnsupportedOperationException",
"}",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/DefaultServletContainerAdapter.java#L131-L136 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateUtilities.java | DateUtilities.isBetweenHours | public static boolean isBetweenHours(int from, int to, TimeZone tz) {
"""
Returns <CODE>true</CODE> if the current date is inside the start and end hours.
@param from The start hour to check that the date is after
@param to The end hour to check that the date is before
@param tz The timezone associated with the... | java | public static boolean isBetweenHours(int from, int to, TimeZone tz)
{
return isBetweenHours(System.currentTimeMillis(), tz, from, to, 0);
} | [
"public",
"static",
"boolean",
"isBetweenHours",
"(",
"int",
"from",
",",
"int",
"to",
",",
"TimeZone",
"tz",
")",
"{",
"return",
"isBetweenHours",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
",",
"tz",
",",
"from",
",",
"to",
",",
"0",
")",
";"... | Returns <CODE>true</CODE> if the current date is inside the start and end hours.
@param from The start hour to check that the date is after
@param to The end hour to check that the date is before
@param tz The timezone associated with the date
@return <CODE>true</CODE> if the current date is inside the start and end ho... | [
"Returns",
"<CODE",
">",
"true<",
"/",
"CODE",
">",
"if",
"the",
"current",
"date",
"is",
"inside",
"the",
"start",
"and",
"end",
"hours",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L149-L152 |
bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java | LocationUtil.getStashLocation | public static StashLocation getStashLocation(URI location) {
"""
Returns location information for a given location of type {@link LocationType#STASH}.
"""
checkArgument(getLocationType(location) == LocationType.STASH, "Not a stash location");
String host, path;
boolean useLatestDirecto... | java | public static StashLocation getStashLocation(URI location) {
checkArgument(getLocationType(location) == LocationType.STASH, "Not a stash location");
String host, path;
boolean useLatestDirectory;
Matcher matcher = getLocatorMatcher(location);
if (matcher.matches()) {
... | [
"public",
"static",
"StashLocation",
"getStashLocation",
"(",
"URI",
"location",
")",
"{",
"checkArgument",
"(",
"getLocationType",
"(",
"location",
")",
"==",
"LocationType",
".",
"STASH",
",",
"\"Not a stash location\"",
")",
";",
"String",
"host",
",",
"path",
... | Returns location information for a given location of type {@link LocationType#STASH}. | [
"Returns",
"location",
"information",
"for",
"a",
"given",
"location",
"of",
"type",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/LocationUtil.java#L317-L350 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CertSelector.java | X509CertSelector.addPathToNameInternal | private void addPathToNameInternal(int type, Object name)
throws IOException {
"""
A private method that adds a name (String or byte array) to the
pathToNames criterion. The {@code X509Certificate} must contain
the specified pathToName.
@param type the name type (0-8, as specified in
RFC 3280, se... | java | private void addPathToNameInternal(int type, Object name)
throws IOException {
// First, ensure that the name parses
GeneralNameInterface tempName = makeGeneralNameInterface(type, name);
if (pathToGeneralNames == null) {
pathToNames = new HashSet<List<?>>();
p... | [
"private",
"void",
"addPathToNameInternal",
"(",
"int",
"type",
",",
"Object",
"name",
")",
"throws",
"IOException",
"{",
"// First, ensure that the name parses",
"GeneralNameInterface",
"tempName",
"=",
"makeGeneralNameInterface",
"(",
"type",
",",
"name",
")",
";",
... | A private method that adds a name (String or byte array) to the
pathToNames criterion. The {@code X509Certificate} must contain
the specified pathToName.
@param type the name type (0-8, as specified in
RFC 3280, section 4.2.1.7)
@param name the name in string or byte array form
@throws IOException if an encoding error... | [
"A",
"private",
"method",
"that",
"adds",
"a",
"name",
"(",
"String",
"or",
"byte",
"array",
")",
"to",
"the",
"pathToNames",
"criterion",
".",
"The",
"{",
"@code",
"X509Certificate",
"}",
"must",
"contain",
"the",
"specified",
"pathToName",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CertSelector.java#L1266-L1279 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newDataAccessException | public static DataAccessException newDataAccessException(String message, Object... args) {
"""
Constructs and initializes a new {@link DataAccessException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link DataAccessEx... | java | public static DataAccessException newDataAccessException(String message, Object... args) {
return newDataAccessException(null, message, args);
} | [
"public",
"static",
"DataAccessException",
"newDataAccessException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newDataAccessException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link DataAccessException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link DataAccessException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"DataAccessException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L153-L155 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java | ParseUtils.unexpectedAttribute | public static XMLStreamException unexpectedAttribute(final XMLExtendedStreamReader reader, final int index, Set<String> possibleAttributes) {
"""
Get an exception reporting an unexpected XML attribute.
@param reader the stream reader
@param index the attribute index
@param possibleAttributes attributes that are... | java | public static XMLStreamException unexpectedAttribute(final XMLExtendedStreamReader reader, final int index, Set<String> possibleAttributes) {
final XMLStreamException ex = ControllerLogger.ROOT_LOGGER.unexpectedAttribute(reader.getAttributeName(index), asStringList(possibleAttributes), reader.getLocation());
... | [
"public",
"static",
"XMLStreamException",
"unexpectedAttribute",
"(",
"final",
"XMLExtendedStreamReader",
"reader",
",",
"final",
"int",
"index",
",",
"Set",
"<",
"String",
">",
"possibleAttributes",
")",
"{",
"final",
"XMLStreamException",
"ex",
"=",
"ControllerLogge... | Get an exception reporting an unexpected XML attribute.
@param reader the stream reader
@param index the attribute index
@param possibleAttributes attributes that are expected on this element
@return the exception | [
"Get",
"an",
"exception",
"reporting",
"an",
"unexpected",
"XML",
"attribute",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/parsing/ParseUtils.java#L151-L160 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ObjectUtils.java | ObjectUtils.identityToString | public static void identityToString(final StringBuffer buffer, final Object object) {
"""
<p>Appends the toString that would be produced by {@code Object}
if a class did not override toString itself. {@code null}
will throw a NullPointerException for either of the two parameters. </p>
<pre>
ObjectUtils.ident... | java | public static void identityToString(final StringBuffer buffer, final Object object) {
Validate.notNull(object, "Cannot get the toString of a null identity");
buffer.append(object.getClass().getName())
.append('@')
.append(Integer.toHexString(System.identityHashCode(object)));... | [
"public",
"static",
"void",
"identityToString",
"(",
"final",
"StringBuffer",
"buffer",
",",
"final",
"Object",
"object",
")",
"{",
"Validate",
".",
"notNull",
"(",
"object",
",",
"\"Cannot get the toString of a null identity\"",
")",
";",
"buffer",
".",
"append",
... | <p>Appends the toString that would be produced by {@code Object}
if a class did not override toString itself. {@code null}
will throw a NullPointerException for either of the two parameters. </p>
<pre>
ObjectUtils.identityToString(buf, "") = buf.append("java.lang.String@1e23"
ObjectUtils.identityToString(bu... | [
"<p",
">",
"Appends",
"the",
"toString",
"that",
"would",
"be",
"produced",
"by",
"{",
"@code",
"Object",
"}",
"if",
"a",
"class",
"did",
"not",
"override",
"toString",
"itself",
".",
"{",
"@code",
"null",
"}",
"will",
"throw",
"a",
"NullPointerException",... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ObjectUtils.java#L404-L409 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLAgentMainLaunchConfigurationTab.java | SARLAgentMainLaunchConfigurationTab.initializeAgentName | protected void initializeAgentName(IJavaElement javaElement, ILaunchConfigurationWorkingCopy config) {
"""
Reset the given configuration with the agent name attributes associated
to the given element.
@param javaElement the element from which information may be retrieved.
@param config the config to set with ... | java | protected void initializeAgentName(IJavaElement javaElement, ILaunchConfigurationWorkingCopy config) {
String name = extractNameFromJavaElement(javaElement);
// Set the attribute
this.configurator.setAgent(config, name);
// Rename the launch configuration
if (name.length() > 0) {
final int index = name.l... | [
"protected",
"void",
"initializeAgentName",
"(",
"IJavaElement",
"javaElement",
",",
"ILaunchConfigurationWorkingCopy",
"config",
")",
"{",
"String",
"name",
"=",
"extractNameFromJavaElement",
"(",
"javaElement",
")",
";",
"// Set the attribute",
"this",
".",
"configurato... | Reset the given configuration with the agent name attributes associated
to the given element.
@param javaElement the element from which information may be retrieved.
@param config the config to set with the agent name. | [
"Reset",
"the",
"given",
"configuration",
"with",
"the",
"agent",
"name",
"attributes",
"associated",
"to",
"the",
"given",
"element",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLAgentMainLaunchConfigurationTab.java#L473-L488 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java | Download.toFile | public static void toFile(final HttpConfig config, final File file) {
"""
Downloads the content to a specified file.
@param config the `HttpConfig` instance
@param file the file where content will be downloaded
"""
toFile(config, ContentTypes.ANY.getAt(0), file);
} | java | public static void toFile(final HttpConfig config, final File file) {
toFile(config, ContentTypes.ANY.getAt(0), file);
} | [
"public",
"static",
"void",
"toFile",
"(",
"final",
"HttpConfig",
"config",
",",
"final",
"File",
"file",
")",
"{",
"toFile",
"(",
"config",
",",
"ContentTypes",
".",
"ANY",
".",
"getAt",
"(",
"0",
")",
",",
"file",
")",
";",
"}"
] | Downloads the content to a specified file.
@param config the `HttpConfig` instance
@param file the file where content will be downloaded | [
"Downloads",
"the",
"content",
"to",
"a",
"specified",
"file",
"."
] | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java#L81-L83 |
Azure/azure-sdk-for-java | policy/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/policy/v2018_03_01/implementation/PolicySetDefinitionsInner.java | PolicySetDefinitionsInner.createOrUpdateAtManagementGroupAsync | public Observable<PolicySetDefinitionInner> createOrUpdateAtManagementGroupAsync(String policySetDefinitionName, String managementGroupId, PolicySetDefinitionInner parameters) {
"""
Creates or updates a policy set definition.
This operation creates or updates a policy set definition in the given management group ... | java | public Observable<PolicySetDefinitionInner> createOrUpdateAtManagementGroupAsync(String policySetDefinitionName, String managementGroupId, PolicySetDefinitionInner parameters) {
return createOrUpdateAtManagementGroupWithServiceResponseAsync(policySetDefinitionName, managementGroupId, parameters).map(new Func1<S... | [
"public",
"Observable",
"<",
"PolicySetDefinitionInner",
">",
"createOrUpdateAtManagementGroupAsync",
"(",
"String",
"policySetDefinitionName",
",",
"String",
"managementGroupId",
",",
"PolicySetDefinitionInner",
"parameters",
")",
"{",
"return",
"createOrUpdateAtManagementGroupW... | Creates or updates a policy set definition.
This operation creates or updates a policy set definition in the given management group with the given name.
@param policySetDefinitionName The name of the policy set definition to create.
@param managementGroupId The ID of the management group.
@param parameters The policy ... | [
"Creates",
"or",
"updates",
"a",
"policy",
"set",
"definition",
".",
"This",
"operation",
"creates",
"or",
"updates",
"a",
"policy",
"set",
"definition",
"in",
"the",
"given",
"management",
"group",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/policy/v2018_03_01/implementation/PolicySetDefinitionsInner.java#L718-L725 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java | RingPlacer.getMidPoint | private static Point2d getMidPoint(Tuple2d a, Tuple2d b) {
"""
Get the middle of two provide points.
@param a first point
@param b second point
@return mid
"""
return new Point2d((a.x + b.x) / 2, (a.y + b.y) / 2);
} | java | private static Point2d getMidPoint(Tuple2d a, Tuple2d b) {
return new Point2d((a.x + b.x) / 2, (a.y + b.y) / 2);
} | [
"private",
"static",
"Point2d",
"getMidPoint",
"(",
"Tuple2d",
"a",
",",
"Tuple2d",
"b",
")",
"{",
"return",
"new",
"Point2d",
"(",
"(",
"a",
".",
"x",
"+",
"b",
".",
"x",
")",
"/",
"2",
",",
"(",
"a",
".",
"y",
"+",
"b",
".",
"y",
")",
"/",
... | Get the middle of two provide points.
@param a first point
@param b second point
@return mid | [
"Get",
"the",
"middle",
"of",
"two",
"provide",
"points",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java#L571-L573 |
tvesalainen/util | util/src/main/java/org/vesalainen/code/PropertyDispatcher.java | PropertyDispatcher.addObserver | public void addObserver(PropertySetter observer, String... properties) {
"""
Adds a PropertySetter observer for properties.
@param observer
@param properties
"""
try
{
semaphore.acquire();
}
catch (InterruptedException ex)
{
throw new Ill... | java | public void addObserver(PropertySetter observer, String... properties)
{
try
{
semaphore.acquire();
}
catch (InterruptedException ex)
{
throw new IllegalArgumentException(ex);
}
try
{
addObserver(observer... | [
"public",
"void",
"addObserver",
"(",
"PropertySetter",
"observer",
",",
"String",
"...",
"properties",
")",
"{",
"try",
"{",
"semaphore",
".",
"acquire",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"ex",
")",
"{",
"throw",
"new",
"IllegalArgum... | Adds a PropertySetter observer for properties.
@param observer
@param properties | [
"Adds",
"a",
"PropertySetter",
"observer",
"for",
"properties",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/code/PropertyDispatcher.java#L104-L126 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/Generator.java | Generator.generatePassphrase | public static String generatePassphrase(final String delimiter, final int words, final Dictionary dictionary) {
"""
Generates a passphrase from the supplied dictionary with the requested word count.
@param delimiter delimiter to place between words
@param words the count of words you want in your passphr... | java | public static String generatePassphrase(final String delimiter, final int words, final Dictionary dictionary)
{
String result = "";
final SecureRandom rnd = new SecureRandom();
final int high = dictionary.getSortedDictionary().size();
for (int i = 1; i <= words; i++)
{
... | [
"public",
"static",
"String",
"generatePassphrase",
"(",
"final",
"String",
"delimiter",
",",
"final",
"int",
"words",
",",
"final",
"Dictionary",
"dictionary",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"final",
"SecureRandom",
"rnd",
"=",
"new",
"Secure... | Generates a passphrase from the supplied dictionary with the requested word count.
@param delimiter delimiter to place between words
@param words the count of words you want in your passphrase
@param dictionary the dictionary to use for generating this passphrase
@return the passphrase | [
"Generates",
"a",
"passphrase",
"from",
"the",
"supplied",
"dictionary",
"with",
"the",
"requested",
"word",
"count",
"."
] | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/Generator.java#L32-L46 |
unbescape/unbescape | src/main/java/org/unbescape/javascript/JavaScriptEscape.java | JavaScriptEscape.unescapeJavaScript | public static void unescapeJavaScript(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform a JavaScript <strong>unescape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
No additional configuration arguments are required. Unesc... | java | public static void unescapeJavaScript(final Reader reader, final Writer writer)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
JavaScriptEscapeUtil.unescape(reader, writer);
} | [
"public",
"static",
"void",
"unescapeJavaScript",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'wr... | <p>
Perform a JavaScript <strong>unescape</strong> operation on a <tt>Reader</tt> input,
writing results to a <tt>Writer</tt>.
</p>
<p>
No additional configuration arguments are required. Unescape operations
will always perform <em>complete</em> JavaScript unescape of SECs, x-based, u-based
and octal escapes.
</p>
<p>
... | [
"<p",
">",
"Perform",
"a",
"JavaScript",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"writing",
"results",
"to",
"a",
"<tt",
">",
"Writer<",
"/",
"tt",
">",
".",
"<",
"/",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/javascript/JavaScriptEscape.java#L1033-L1042 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/ObjectListAttributeDefinition.java | ObjectListAttributeDefinition.resolveValue | @Override
public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException {
"""
Overrides the superclass implementation to allow the value type's AttributeDefinition to in turn
resolve each element.
{@inheritDoc}
"""
// Pass non-LIST values through t... | java | @Override
public ModelNode resolveValue(ExpressionResolver resolver, ModelNode value) throws OperationFailedException {
// Pass non-LIST values through the superclass so it can reject weird values and, in the odd chance
// that's how this object is set up, turn undefined into a default list value.
... | [
"@",
"Override",
"public",
"ModelNode",
"resolveValue",
"(",
"ExpressionResolver",
"resolver",
",",
"ModelNode",
"value",
")",
"throws",
"OperationFailedException",
"{",
"// Pass non-LIST values through the superclass so it can reject weird values and, in the odd chance",
"// that's ... | Overrides the superclass implementation to allow the value type's AttributeDefinition to in turn
resolve each element.
{@inheritDoc} | [
"Overrides",
"the",
"superclass",
"implementation",
"to",
"allow",
"the",
"value",
"type",
"s",
"AttributeDefinition",
"to",
"in",
"turn",
"resolve",
"each",
"element",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/ObjectListAttributeDefinition.java#L133-L155 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java | LdapConnection.cloneSearchResults | @FFDCIgnore(SizeLimitExceededException.class)
private static int cloneSearchResults(NamingEnumeration<SearchResult> results, CachedNamingEnumeration clone1,
CachedNamingEnumeration clone2) throws WIMSystemException {
"""
Clone the given {@link NamingNumeration}.
@pa... | java | @FFDCIgnore(SizeLimitExceededException.class)
private static int cloneSearchResults(NamingEnumeration<SearchResult> results, CachedNamingEnumeration clone1,
CachedNamingEnumeration clone2) throws WIMSystemException {
final String METHODNAME = "cloneSearchResults(Nam... | [
"@",
"FFDCIgnore",
"(",
"SizeLimitExceededException",
".",
"class",
")",
"private",
"static",
"int",
"cloneSearchResults",
"(",
"NamingEnumeration",
"<",
"SearchResult",
">",
"results",
",",
"CachedNamingEnumeration",
"clone1",
",",
"CachedNamingEnumeration",
"clone2",
... | Clone the given {@link NamingNumeration}.
@param results The results to clone.
@param clone1 {@link CachedNamingEnumeration} with the original results.
@param clone2 {@link CachedNamingEnumeration} with the cloned results.
@return The number of entries in the results.
@throws WIMSystemException If the results could no... | [
"Clone",
"the",
"given",
"{",
"@link",
"NamingNumeration",
"}",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java#L1327-L1352 |
calimero-project/calimero-core | src/tuwien/auto/calimero/link/KNXNetworkLinkIP.java | KNXNetworkLinkIP.sendRequestWait | @Override
public void sendRequestWait(final KNXAddress dst, final Priority p, final byte[] nsdu)
throws KNXTimeoutException, KNXLinkClosedException {
"""
{@inheritDoc} When communicating with a KNX network which uses open medium, messages are broadcasted within
domain (as opposite to system broadcast) by defau... | java | @Override
public void sendRequestWait(final KNXAddress dst, final Priority p, final byte[] nsdu)
throws KNXTimeoutException, KNXLinkClosedException
{
final int mc = mode == TUNNELING ? CEMILData.MC_LDATA_REQ : CEMILData.MC_LDATA_IND;
send(mc, dst, p, nsdu, true);
} | [
"@",
"Override",
"public",
"void",
"sendRequestWait",
"(",
"final",
"KNXAddress",
"dst",
",",
"final",
"Priority",
"p",
",",
"final",
"byte",
"[",
"]",
"nsdu",
")",
"throws",
"KNXTimeoutException",
",",
"KNXLinkClosedException",
"{",
"final",
"int",
"mc",
"=",... | {@inheritDoc} When communicating with a KNX network which uses open medium, messages are broadcasted within
domain (as opposite to system broadcast) by default. Specify <code>dst null</code> for system broadcast. | [
"{"
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/link/KNXNetworkLinkIP.java#L267-L273 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.plusYears | public Period plusYears(int years) {
"""
Returns a new period with the specified number of years added.
<p>
This period instance is immutable and unaffected by this method call.
@param years the amount of years to add, may be negative
@return the new period with the increased years
@throws UnsupportedOpera... | java | public Period plusYears(int years) {
if (years == 0) {
return this;
}
int[] values = getValues(); // cloned
getPeriodType().addIndexedField(this, PeriodType.YEAR_INDEX, values, years);
return new Period(values, getPeriodType());
} | [
"public",
"Period",
"plusYears",
"(",
"int",
"years",
")",
"{",
"if",
"(",
"years",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"[",
"]",
"values",
"=",
"getValues",
"(",
")",
";",
"// cloned",
"getPeriodType",
"(",
")",
".",
"addIndexedF... | Returns a new period with the specified number of years added.
<p>
This period instance is immutable and unaffected by this method call.
@param years the amount of years to add, may be negative
@return the new period with the increased years
@throws UnsupportedOperationException if the field is not supported | [
"Returns",
"a",
"new",
"period",
"with",
"the",
"specified",
"number",
"of",
"years",
"added",
".",
"<p",
">",
"This",
"period",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L1069-L1076 |
Clivern/Racter | src/main/java/com/clivern/racter/senders/templates/GenericTemplate.java | GenericTemplate.setElementDefaultAction | public void setElementDefaultAction(Integer index, String type, String url, Boolean messenger_extensions, String webview_height_ratio, String fallback_url) {
"""
Set Element Default Action
@param index the element index
@param type the element type
@param url the element url
@param messenger_extensions the m... | java | public void setElementDefaultAction(Integer index, String type, String url, Boolean messenger_extensions, String webview_height_ratio, String fallback_url)
{
this.elements.get(index).put("default_action_type", type);
this.elements.get(index).put("default_action_url", url);
this.elements.get(... | [
"public",
"void",
"setElementDefaultAction",
"(",
"Integer",
"index",
",",
"String",
"type",
",",
"String",
"url",
",",
"Boolean",
"messenger_extensions",
",",
"String",
"webview_height_ratio",
",",
"String",
"fallback_url",
")",
"{",
"this",
".",
"elements",
".",... | Set Element Default Action
@param index the element index
@param type the element type
@param url the element url
@param messenger_extensions the messenger extensions
@param webview_height_ratio the webview height ratio
@param fallback_url the fallback url | [
"Set",
"Element",
"Default",
"Action"
] | train | https://github.com/Clivern/Racter/blob/bbde02f0c2a8a80653ad6b1607376d8408acd71c/src/main/java/com/clivern/racter/senders/templates/GenericTemplate.java#L84-L91 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyAssertionAxiomImpl_CustomFieldSerializer.java | OWLDataPropertyAssertionAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataPropertyAssertionAxiomImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link ... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataPropertyAssertionAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataPropertyAssertionAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataPropertyAssertionAxiomImpl_CustomFieldSerializer.java#L98-L101 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpComparator.java | SdpComparator.negotiateApplication | public RTPFormats negotiateApplication(SessionDescription sdp, RTPFormats formats) {
"""
Negotiates the application formats to be used in the call.
@param sdp The session description
@param formats The available formats
@return The supported formats. If no formats are supported the returned list will be empty.
... | java | public RTPFormats negotiateApplication(SessionDescription sdp, RTPFormats formats) {
this.application.clean();
MediaDescriptorField descriptor = sdp.getApplicationDescriptor();
descriptor.getFormats().intersection(formats, this.application);
return this.application;
} | [
"public",
"RTPFormats",
"negotiateApplication",
"(",
"SessionDescription",
"sdp",
",",
"RTPFormats",
"formats",
")",
"{",
"this",
".",
"application",
".",
"clean",
"(",
")",
";",
"MediaDescriptorField",
"descriptor",
"=",
"sdp",
".",
"getApplicationDescriptor",
"(",... | Negotiates the application formats to be used in the call.
@param sdp The session description
@param formats The available formats
@return The supported formats. If no formats are supported the returned list will be empty. | [
"Negotiates",
"the",
"application",
"formats",
"to",
"be",
"used",
"in",
"the",
"call",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/sdp/SdpComparator.java#L96-L101 |
aoindustries/aocode-public | src/main/java/com/aoindustries/util/StringUtility.java | StringUtility.countOccurances | @Deprecated
public static int countOccurances(byte[] buff, int len, String word) {
"""
Counts how many times a word appears in a line. Case insensitive matching.
@deprecated Corrected spelling
"""
return countOccurrences(buff, len, word);
} | java | @Deprecated
public static int countOccurances(byte[] buff, int len, String word) {
return countOccurrences(buff, len, word);
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"countOccurances",
"(",
"byte",
"[",
"]",
"buff",
",",
"int",
"len",
",",
"String",
"word",
")",
"{",
"return",
"countOccurrences",
"(",
"buff",
",",
"len",
",",
"word",
")",
";",
"}"
] | Counts how many times a word appears in a line. Case insensitive matching.
@deprecated Corrected spelling | [
"Counts",
"how",
"many",
"times",
"a",
"word",
"appears",
"in",
"a",
"line",
".",
"Case",
"insensitive",
"matching",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L299-L302 |
joniles/mpxj | src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java | DatatypeConverter.getInt | public static final int getInt(InputStream is) throws IOException {
"""
Read an int from an input stream.
@param is input stream
@return int value
"""
byte[] data = new byte[4];
is.read(data);
return getInt(data, 0);
} | java | public static final int getInt(InputStream is) throws IOException
{
byte[] data = new byte[4];
is.read(data);
return getInt(data, 0);
} | [
"public",
"static",
"final",
"int",
"getInt",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"is",
".",
"read",
"(",
"data",
")",
";",
"return",
"getInt",
"(",
"data",
... | Read an int from an input stream.
@param is input stream
@return int value | [
"Read",
"an",
"int",
"from",
"an",
"input",
"stream",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/synchro/DatatypeConverter.java#L132-L137 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/misc/TransposeAlgs_ZDRM.java | TransposeAlgs_ZDRM.standard | public static void standard(ZMatrixRMaj A, ZMatrixRMaj A_tran) {
"""
A straight forward transpose. Good for small non-square matrices.
@param A Original matrix. Not modified.
@param A_tran Transposed matrix. Modified.
"""
int index = 0;
int rowStrideTran = A_tran.getRowStride();
... | java | public static void standard(ZMatrixRMaj A, ZMatrixRMaj A_tran)
{
int index = 0;
int rowStrideTran = A_tran.getRowStride();
int rowStride = A.getRowStride();
for( int i = 0; i < A_tran.numRows; i++ ) {
int index2 = i*2;
int end = index + rowStrideTran;
... | [
"public",
"static",
"void",
"standard",
"(",
"ZMatrixRMaj",
"A",
",",
"ZMatrixRMaj",
"A_tran",
")",
"{",
"int",
"index",
"=",
"0",
";",
"int",
"rowStrideTran",
"=",
"A_tran",
".",
"getRowStride",
"(",
")",
";",
"int",
"rowStride",
"=",
"A",
".",
"getRowS... | A straight forward transpose. Good for small non-square matrices.
@param A Original matrix. Not modified.
@param A_tran Transposed matrix. Modified. | [
"A",
"straight",
"forward",
"transpose",
".",
"Good",
"for",
"small",
"non",
"-",
"square",
"matrices",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/misc/TransposeAlgs_ZDRM.java#L85-L100 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/annotations/Annotation.java | Annotation.getFieldAccessors | public static JMapAccessor getFieldAccessors(Class<?> clazz, Field field) {
"""
Returns JMapAccessor relative to this field, null if not present.
@param clazz field's class
@param field to check
@return JMapAccessor if exists, null otherwise
"""
return getFieldAccessors(clazz,field,false, field.getName()... | java | public static JMapAccessor getFieldAccessors(Class<?> clazz, Field field){
return getFieldAccessors(clazz,field,false, field.getName(),Constants.DEFAULT_FIELD_VALUE);
} | [
"public",
"static",
"JMapAccessor",
"getFieldAccessors",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Field",
"field",
")",
"{",
"return",
"getFieldAccessors",
"(",
"clazz",
",",
"field",
",",
"false",
",",
"field",
".",
"getName",
"(",
")",
",",
"Constants... | Returns JMapAccessor relative to this field, null if not present.
@param clazz field's class
@param field to check
@return JMapAccessor if exists, null otherwise | [
"Returns",
"JMapAccessor",
"relative",
"to",
"this",
"field",
"null",
"if",
"not",
"present",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/annotations/Annotation.java#L104-L106 |
samskivert/pythagoras | src/main/java/pythagoras/d/Matrix4.java | Matrix4.setToTransform | public Matrix4 setToTransform (IVector3 translation, IQuaternion rotation, double scale) {
"""
Sets this to a matrix that first scales, then rotates, then translates.
@return a reference to this matrix, for chaining.
"""
return setToRotation(rotation).set(
m00 * scale, m10 * scale, m20 *... | java | public Matrix4 setToTransform (IVector3 translation, IQuaternion rotation, double scale) {
return setToRotation(rotation).set(
m00 * scale, m10 * scale, m20 * scale, translation.x(),
m01 * scale, m11 * scale, m21 * scale, translation.y(),
m02 * scale, m12 * scale, m22 * scale... | [
"public",
"Matrix4",
"setToTransform",
"(",
"IVector3",
"translation",
",",
"IQuaternion",
"rotation",
",",
"double",
"scale",
")",
"{",
"return",
"setToRotation",
"(",
"rotation",
")",
".",
"set",
"(",
"m00",
"*",
"scale",
",",
"m10",
"*",
"scale",
",",
"... | Sets this to a matrix that first scales, then rotates, then translates.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"matrix",
"that",
"first",
"scales",
"then",
"rotates",
"then",
"translates",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Matrix4.java#L112-L118 |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/adapter/ServiceEventAdapter.java | ServiceEventAdapter.serviceChanged | @Override
public void serviceChanged(ServiceEvent serviceEvent) {
"""
Receive notification of a service lifecycle change event and adapt it to
the format required for the <code>EventAdmin</code> service.
@param serviceEvent
the service lifecycle event to publish as an <code>Event</code>
"""
fi... | java | @Override
public void serviceChanged(ServiceEvent serviceEvent) {
final String topic = getTopic(serviceEvent);
// Bail quickly if the event is one that should be ignored
if (topic == null) {
return;
}
// Event properties
Map<String, Object> eventProperti... | [
"@",
"Override",
"public",
"void",
"serviceChanged",
"(",
"ServiceEvent",
"serviceEvent",
")",
"{",
"final",
"String",
"topic",
"=",
"getTopic",
"(",
"serviceEvent",
")",
";",
"// Bail quickly if the event is one that should be ignored",
"if",
"(",
"topic",
"==",
"nul... | Receive notification of a service lifecycle change event and adapt it to
the format required for the <code>EventAdmin</code> service.
@param serviceEvent
the service lifecycle event to publish as an <code>Event</code> | [
"Receive",
"notification",
"of",
"a",
"service",
"lifecycle",
"change",
"event",
"and",
"adapt",
"it",
"to",
"the",
"format",
"required",
"for",
"the",
"<code",
">",
"EventAdmin<",
"/",
"code",
">",
"service",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/adapter/ServiceEventAdapter.java#L55-L99 |
redisson/redisson | redisson/src/main/java/org/redisson/misc/HighwayHash.java | HighwayHash.updatePacket | public void updatePacket(byte[] packet, int pos) {
"""
Updates the hash with 32 bytes of data. If you can read 4 long values
from your data efficiently, prefer using update() instead for more speed.
@param packet data array which has a length of at least pos + 32
@param pos position in the array to read the fir... | java | public void updatePacket(byte[] packet, int pos) {
if (pos < 0) {
throw new IllegalArgumentException(String.format("Pos (%s) must be positive", pos));
}
if (pos + 32 > packet.length) {
throw new IllegalArgumentException("packet must have at least 32 bytes after pos");
}
long a0 = read64(... | [
"public",
"void",
"updatePacket",
"(",
"byte",
"[",
"]",
"packet",
",",
"int",
"pos",
")",
"{",
"if",
"(",
"pos",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"Pos (%s) must be positive\"",
",",
"pos"... | Updates the hash with 32 bytes of data. If you can read 4 long values
from your data efficiently, prefer using update() instead for more speed.
@param packet data array which has a length of at least pos + 32
@param pos position in the array to read the first of 32 bytes from | [
"Updates",
"the",
"hash",
"with",
"32",
"bytes",
"of",
"data",
".",
"If",
"you",
"can",
"read",
"4",
"long",
"values",
"from",
"your",
"data",
"efficiently",
"prefer",
"using",
"update",
"()",
"instead",
"for",
"more",
"speed",
"."
] | train | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/misc/HighwayHash.java#L56-L68 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201902/activitygroupservice/GetActiveActivityGroups.java | GetActiveActivityGroups.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
ActivityGroupServiceInterface activityGroupService =
adManagerServices.get(session, ActivityGroupServiceInterface.class);
// Create a statement to select activity groups.
Stat... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"ActivityGroupServiceInterface",
"activityGroupService",
"=",
"adManagerServices",
".",
"get",
"(",
"session",... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201902/activitygroupservice/GetActiveActivityGroups.java#L52-L87 |
Hygieia/Hygieia | hygieia-jenkins-plugin/src/main/java/hygieia/utils/HygieiaUtils.java | HygieiaUtils.determineArtifactName | public static String determineArtifactName(FilePath file, String version) {
"""
Determine the artifact's name. The name excludes the version string and the file extension.
Does not currently support classifiers
@param file
@param version
@return
"""
String fileName = file.getBaseName();
... | java | public static String determineArtifactName(FilePath file, String version) {
String fileName = file.getBaseName();
if ("".equals(version)) return fileName;
int vIndex = fileName.indexOf(version);
if (vIndex <= 0) return fileName;
if ((fileName.charAt(vIndex - 1) == '-') || (fi... | [
"public",
"static",
"String",
"determineArtifactName",
"(",
"FilePath",
"file",
",",
"String",
"version",
")",
"{",
"String",
"fileName",
"=",
"file",
".",
"getBaseName",
"(",
")",
";",
"if",
"(",
"\"\"",
".",
"equals",
"(",
"version",
")",
")",
"return",
... | Determine the artifact's name. The name excludes the version string and the file extension.
Does not currently support classifiers
@param file
@param version
@return | [
"Determine",
"the",
"artifact",
"s",
"name",
".",
"The",
"name",
"excludes",
"the",
"version",
"string",
"and",
"the",
"file",
"extension",
"."
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/hygieia-jenkins-plugin/src/main/java/hygieia/utils/HygieiaUtils.java#L85-L96 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java | ConnectionMonitorsInner.beginCreateOrUpdateAsync | public Observable<ConnectionMonitorResultInner> beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) {
"""
Create or update a connection monitor.
@param resourceGroupName The name of the resource group containing Network W... | java | public Observable<ConnectionMonitorResultInner> beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parame... | [
"public",
"Observable",
"<",
"ConnectionMonitorResultInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"connectionMonitorName",
",",
"ConnectionMonitorInner",
"parameters",
")",
"{",
"return",
"b... | Create or update a connection monitor.
@param resourceGroupName The name of the resource group containing Network Watcher.
@param networkWatcherName The name of the Network Watcher resource.
@param connectionMonitorName The name of the connection monitor.
@param parameters Parameters that define the operation to creat... | [
"Create",
"or",
"update",
"a",
"connection",
"monitor",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java#L233-L240 |
redkale/redkale | src/org/redkale/net/http/HttpRequest.java | HttpRequest.getJsonParameter | public <T> T getJsonParameter(JsonConvert convert, java.lang.reflect.Type type, String name) {
"""
获取指定的参数json值
@param <T> 泛型
@param convert JsonConvert对象
@param type 反序列化的类名
@param name 参数名
@return 参数值
"""
String v = getParameter(name);
return v == null || v.isEmpty() ? nu... | java | public <T> T getJsonParameter(JsonConvert convert, java.lang.reflect.Type type, String name) {
String v = getParameter(name);
return v == null || v.isEmpty() ? null : convert.convertFrom(type, v);
} | [
"public",
"<",
"T",
">",
"T",
"getJsonParameter",
"(",
"JsonConvert",
"convert",
",",
"java",
".",
"lang",
".",
"reflect",
".",
"Type",
"type",
",",
"String",
"name",
")",
"{",
"String",
"v",
"=",
"getParameter",
"(",
"name",
")",
";",
"return",
"v",
... | 获取指定的参数json值
@param <T> 泛型
@param convert JsonConvert对象
@param type 反序列化的类名
@param name 参数名
@return 参数值 | [
"获取指定的参数json值"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/net/http/HttpRequest.java#L1301-L1304 |
biezhi/anima | src/main/java/io/github/biezhi/anima/Anima.java | Anima.deleteBatch | public static <T extends Model, S extends Serializable> void deleteBatch(Class<T> model, List<S> idList) {
"""
Batch delete model with List
@param model model class type
@param idList mode primary id list
@param <T>
@param <S>
"""
deleteBatch(model, AnimaUtils.toArray(idList));
} | java | public static <T extends Model, S extends Serializable> void deleteBatch(Class<T> model, List<S> idList) {
deleteBatch(model, AnimaUtils.toArray(idList));
} | [
"public",
"static",
"<",
"T",
"extends",
"Model",
",",
"S",
"extends",
"Serializable",
">",
"void",
"deleteBatch",
"(",
"Class",
"<",
"T",
">",
"model",
",",
"List",
"<",
"S",
">",
"idList",
")",
"{",
"deleteBatch",
"(",
"model",
",",
"AnimaUtils",
"."... | Batch delete model with List
@param model model class type
@param idList mode primary id list
@param <T>
@param <S> | [
"Batch",
"delete",
"model",
"with",
"List"
] | train | https://github.com/biezhi/anima/blob/d6655e47ac4c08d9d7f961ac0569062bead8b1ed/src/main/java/io/github/biezhi/anima/Anima.java#L432-L434 |
jboss-integration/fuse-bxms-integ | quickstarts/switchyard-demo-library/src/main/java/org/switchyard/quickstarts/demos/library/Library.java | Library.addBook | private void addBook(String isbn, String title, String synopsis, int quantity) {
"""
Adds the book.
@param isbn the isbn
@param title the title
@param synopsis the synopsis
@param quantity the quantity
"""
Book book = new Book();
book.setIsbn(isbn);
book.setTitle(title);
b... | java | private void addBook(String isbn, String title, String synopsis, int quantity) {
Book book = new Book();
book.setIsbn(isbn);
book.setTitle(title);
book.setSynopsis(synopsis);
isbns_to_books.put(isbn, book);
isbns_to_quantities.put(isbn, quantity);
} | [
"private",
"void",
"addBook",
"(",
"String",
"isbn",
",",
"String",
"title",
",",
"String",
"synopsis",
",",
"int",
"quantity",
")",
"{",
"Book",
"book",
"=",
"new",
"Book",
"(",
")",
";",
"book",
".",
"setIsbn",
"(",
"isbn",
")",
";",
"book",
".",
... | Adds the book.
@param isbn the isbn
@param title the title
@param synopsis the synopsis
@param quantity the quantity | [
"Adds",
"the",
"book",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/quickstarts/switchyard-demo-library/src/main/java/org/switchyard/quickstarts/demos/library/Library.java#L81-L88 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java | ListManagementTermsImpl.getAllTermsWithServiceResponseAsync | public Observable<ServiceResponse<Terms>> getAllTermsWithServiceResponseAsync(String listId, String language, GetAllTermsOptionalParameter getAllTermsOptionalParameter) {
"""
Gets all terms from the list with list Id equal to the list Id passed.
@param listId List Id of the image list.
@param language Language... | java | public Observable<ServiceResponse<Terms>> getAllTermsWithServiceResponseAsync(String listId, String language, GetAllTermsOptionalParameter getAllTermsOptionalParameter) {
if (this.client.baseUrl() == null) {
throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and cannot b... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Terms",
">",
">",
"getAllTermsWithServiceResponseAsync",
"(",
"String",
"listId",
",",
"String",
"language",
",",
"GetAllTermsOptionalParameter",
"getAllTermsOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"c... | Gets all terms from the list with list Id equal to the list Id passed.
@param listId List Id of the image list.
@param language Language of the terms.
@param getAllTermsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if paramet... | [
"Gets",
"all",
"terms",
"from",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"the",
"list",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementTermsImpl.java#L317-L331 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java | MetricsStore.getFullInstanceId | private static String getFullInstanceId(String hostname, String id) {
"""
Gets the full instance id of the concatenation of hostname and the id. The dots in the hostname
replaced by underscores.
@param hostname the hostname
@param id the instance id
@return the full instance id of hostname[:id]
"""
S... | java | private static String getFullInstanceId(String hostname, String id) {
String str = hostname == null ? "" : hostname;
str = str.replace('.', '_');
str += (id == null ? "" : "-" + id);
return str;
} | [
"private",
"static",
"String",
"getFullInstanceId",
"(",
"String",
"hostname",
",",
"String",
"id",
")",
"{",
"String",
"str",
"=",
"hostname",
"==",
"null",
"?",
"\"\"",
":",
"hostname",
";",
"str",
"=",
"str",
".",
"replace",
"(",
"'",
"'",
",",
"'",... | Gets the full instance id of the concatenation of hostname and the id. The dots in the hostname
replaced by underscores.
@param hostname the hostname
@param id the instance id
@return the full instance id of hostname[:id] | [
"Gets",
"the",
"full",
"instance",
"id",
"of",
"the",
"concatenation",
"of",
"hostname",
"and",
"the",
"id",
".",
"The",
"dots",
"in",
"the",
"hostname",
"replaced",
"by",
"underscores",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/metrics/MetricsStore.java#L68-L73 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/segment/VirtualColumns.java | VirtualColumns.makeDimensionSelector | public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec, ColumnSelectorFactory factory) {
"""
Create a dimension (string) selector.
@param dimensionSpec the dimensionSpec for this selector
@param factory base column selector factory
@return selector
@throws IllegalArgumentExcepti... | java | public DimensionSelector makeDimensionSelector(DimensionSpec dimensionSpec, ColumnSelectorFactory factory)
{
final VirtualColumn virtualColumn = getVirtualColumn(dimensionSpec.getDimension());
if (virtualColumn == null) {
throw new IAE("No such virtual column[%s]", dimensionSpec.getDimension());
} e... | [
"public",
"DimensionSelector",
"makeDimensionSelector",
"(",
"DimensionSpec",
"dimensionSpec",
",",
"ColumnSelectorFactory",
"factory",
")",
"{",
"final",
"VirtualColumn",
"virtualColumn",
"=",
"getVirtualColumn",
"(",
"dimensionSpec",
".",
"getDimension",
"(",
")",
")",
... | Create a dimension (string) selector.
@param dimensionSpec the dimensionSpec for this selector
@param factory base column selector factory
@return selector
@throws IllegalArgumentException if the virtual column does not exist (see {@link #exists(String)} | [
"Create",
"a",
"dimension",
"(",
"string",
")",
"selector",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/segment/VirtualColumns.java#L162-L172 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java | RouteFiltersInner.beginCreateOrUpdateAsync | public Observable<RouteFilterInner> beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) {
"""
Creates or updates a route filter in a specified resource group.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name ... | java | public Observable<RouteFilterInner> beginCreateOrUpdateAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1<ServiceResponse<RouteFilterInner>, ... | [
"public",
"Observable",
"<",
"RouteFilterInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeFilterName",
",",
"RouteFilterInner",
"routeFilterParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"r... | Creates or updates a route filter in a specified resource group.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route filter.
@param routeFilterParameters Parameters supplied to the create or update route filter operation.
@throws IllegalArgumentException thrown if para... | [
"Creates",
"or",
"updates",
"a",
"route",
"filter",
"in",
"a",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java#L545-L552 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/StandardFieldsDialog.java | StandardFieldsDialog.setContextValue | public void setContextValue(String fieldLabel, Context context) {
"""
Sets the (selected) context of a {@link ContextSelectComboBox} field.
<p>
The call to this method has no effect it the context is not present in the combo box.
@param fieldLabel the label of the field
@param context the context to be set/s... | java | public void setContextValue(String fieldLabel, Context context) {
Component c = this.fieldMap.get(fieldLabel);
if (c != null) {
if (c instanceof ContextSelectComboBox) {
((ContextSelectComboBox) c).setSelectedItem(context);
} else {
handleUnexpectedFieldClass(fieldLabel, c);
}
}
} | [
"public",
"void",
"setContextValue",
"(",
"String",
"fieldLabel",
",",
"Context",
"context",
")",
"{",
"Component",
"c",
"=",
"this",
".",
"fieldMap",
".",
"get",
"(",
"fieldLabel",
")",
";",
"if",
"(",
"c",
"!=",
"null",
")",
"{",
"if",
"(",
"c",
"i... | Sets the (selected) context of a {@link ContextSelectComboBox} field.
<p>
The call to this method has no effect it the context is not present in the combo box.
@param fieldLabel the label of the field
@param context the context to be set/selected, {@code null} to clear the selection.
@since 2.6.0
@see #getContextValue... | [
"Sets",
"the",
"(",
"selected",
")",
"context",
"of",
"a",
"{",
"@link",
"ContextSelectComboBox",
"}",
"field",
".",
"<p",
">",
"The",
"call",
"to",
"this",
"method",
"has",
"no",
"effect",
"it",
"the",
"context",
"is",
"not",
"present",
"in",
"the",
"... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/StandardFieldsDialog.java#L1569-L1578 |
javafxports/javafxmobile-plugin | src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java | SignedJarBuilder.writeEntry | private void writeEntry(InputStream input, JarEntry entry) throws IOException {
"""
Adds an entry to the output jar, and write its content from the {@link InputStream}
@param input The input stream from where to write the entry content.
@param entry the entry to write in the jar.
@throws IOException
"""
... | java | private void writeEntry(InputStream input, JarEntry entry) throws IOException {
// add the entry to the jar archive
mOutputJar.putNextEntry(entry);
// read the content of the entry from the input stream, and write it into the archive.
int count;
while ((count = input.read(mBuffe... | [
"private",
"void",
"writeEntry",
"(",
"InputStream",
"input",
",",
"JarEntry",
"entry",
")",
"throws",
"IOException",
"{",
"// add the entry to the jar archive",
"mOutputJar",
".",
"putNextEntry",
"(",
"entry",
")",
";",
"// read the content of the entry from the input stre... | Adds an entry to the output jar, and write its content from the {@link InputStream}
@param input The input stream from where to write the entry content.
@param entry the entry to write in the jar.
@throws IOException | [
"Adds",
"an",
"entry",
"to",
"the",
"output",
"jar",
"and",
"write",
"its",
"content",
"from",
"the",
"{"
] | train | https://github.com/javafxports/javafxmobile-plugin/blob/a9bef513b7e1bfa85f9a668226e6943c6d9f847f/src/main/java/org/javafxports/jfxmobile/plugin/android/task/SignedJarBuilder.java#L289-L316 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java | TmdbTV.getTVContentRatings | public ResultList<ContentRating> getTVContentRatings(int tvID) throws MovieDbException {
"""
Get the content ratings for a specific TV show id.
@param tvID
@return
@throws com.omertron.themoviedbapi.MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param... | java | public ResultList<ContentRating> getTVContentRatings(int tvID) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, tvID);
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.CONTENT_RATINGS).buildUrl(parameters);
WrapperGeneri... | [
"public",
"ResultList",
"<",
"ContentRating",
">",
"getTVContentRatings",
"(",
"int",
"tvID",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"ID",
... | Get the content ratings for a specific TV show id.
@param tvID
@return
@throws com.omertron.themoviedbapi.MovieDbException | [
"Get",
"the",
"content",
"ratings",
"for",
"a",
"specific",
"TV",
"show",
"id",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java#L159-L166 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.infov | public void infov(Throwable t, String format, Object... params) {
"""
Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting.
@param t the throwable
@param format the message format string
@param params the parameters
"""
doLog(Level.INFO, FQCN, format, par... | java | public void infov(Throwable t, String format, Object... params) {
doLog(Level.INFO, FQCN, format, params, t);
} | [
"public",
"void",
"infov",
"(",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLog",
"(",
"Level",
".",
"INFO",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"t",
")",
";",
"}"
] | Issue a log message with a level of INFO using {@link java.text.MessageFormat}-style formatting.
@param t the throwable
@param format the message format string
@param params the parameters | [
"Issue",
"a",
"log",
"message",
"with",
"a",
"level",
"of",
"INFO",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1072-L1074 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java | ProcessUtil.onProcessExited | public static void onProcessExited(Process process, Listener<Integer> exitValueListener) {
"""
Create a thread that wait for the given process to end, and call the given listener.
"""
Application app = LCCore.getApplication();
Mutable<Thread> mt = new Mutable<>(null);
Thread t = app.getThreadFactory()... | java | public static void onProcessExited(Process process, Listener<Integer> exitValueListener) {
Application app = LCCore.getApplication();
Mutable<Thread> mt = new Mutable<>(null);
Thread t = app.getThreadFactory().newThread(() -> {
try { exitValueListener.fire(Integer.valueOf(process.waitFor())); }
catch (... | [
"public",
"static",
"void",
"onProcessExited",
"(",
"Process",
"process",
",",
"Listener",
"<",
"Integer",
">",
"exitValueListener",
")",
"{",
"Application",
"app",
"=",
"LCCore",
".",
"getApplication",
"(",
")",
";",
"Mutable",
"<",
"Thread",
">",
"mt",
"="... | Create a thread that wait for the given process to end, and call the given listener. | [
"Create",
"a",
"thread",
"that",
"wait",
"for",
"the",
"given",
"process",
"to",
"end",
"and",
"call",
"the",
"given",
"listener",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java#L22-L34 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java | ChannelFrameworkImpl.cleanChildRefsInParent | private void cleanChildRefsInParent(ChannelData channelDataArray[], boolean childrenNew[]) {
"""
This is a helper function. The same logic needs to be done in multiple
places so
this method was written to break it out. It will be called in times when an
exception
occurred during the construction of a chain. It... | java | private void cleanChildRefsInParent(ChannelData channelDataArray[], boolean childrenNew[]) {
ChildChannelDataImpl child = null;
// Clean up the already child refs in the parent.
for (int i = 0; i < channelDataArray.length; i++) {
if (childrenNew[i] == true) {
child = ... | [
"private",
"void",
"cleanChildRefsInParent",
"(",
"ChannelData",
"channelDataArray",
"[",
"]",
",",
"boolean",
"childrenNew",
"[",
"]",
")",
"{",
"ChildChannelDataImpl",
"child",
"=",
"null",
";",
"// Clean up the already child refs in the parent.",
"for",
"(",
"int",
... | This is a helper function. The same logic needs to be done in multiple
places so
this method was written to break it out. It will be called in times when an
exception
occurred during the construction of a chain. It cleans up some of the
objects that
were lined up ahead of time.
@param channelDataArray
@param childrenN... | [
"This",
"is",
"a",
"helper",
"function",
".",
"The",
"same",
"logic",
"needs",
"to",
"be",
"done",
"in",
"multiple",
"places",
"so",
"this",
"method",
"was",
"written",
"to",
"break",
"it",
"out",
".",
"It",
"will",
"be",
"called",
"in",
"times",
"when... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelFrameworkImpl.java#L2508-L2517 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/ColumnText.java | ColumnText.setSimpleColumn | public void setSimpleColumn(float llx, float lly, float urx, float ury) {
"""
Simplified method for rectangular columns.
@param llx
@param lly
@param urx
@param ury
"""
leftX = Math.min(llx, urx);
maxY = Math.max(lly, ury);
minY = Math.min(lly, ury);
rightX = Math.max(llx,... | java | public void setSimpleColumn(float llx, float lly, float urx, float ury) {
leftX = Math.min(llx, urx);
maxY = Math.max(lly, ury);
minY = Math.min(lly, ury);
rightX = Math.max(llx, urx);
yLine = maxY;
rectangularWidth = rightX - leftX;
if (rectangularWidth < 0)
... | [
"public",
"void",
"setSimpleColumn",
"(",
"float",
"llx",
",",
"float",
"lly",
",",
"float",
"urx",
",",
"float",
"ury",
")",
"{",
"leftX",
"=",
"Math",
".",
"min",
"(",
"llx",
",",
"urx",
")",
";",
"maxY",
"=",
"Math",
".",
"max",
"(",
"lly",
",... | Simplified method for rectangular columns.
@param llx
@param lly
@param urx
@param ury | [
"Simplified",
"method",
"for",
"rectangular",
"columns",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/ColumnText.java#L638-L648 |
facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/DynamicByteArray.java | DynamicByteArray.add | public int add(byte[] value, int valueOffset, int valueLength) {
"""
Copy a slice of a byte array into our buffer.
@param value the array to copy from
@param valueOffset the first location to copy from value
@param valueLength the number of bytes to copy from value
@return the offset of the start of the value
... | java | public int add(byte[] value, int valueOffset, int valueLength) {
grow(length + valueLength);
data.setBytes(length, value, valueOffset, valueLength);
int result = length;
length += valueLength;
return result;
} | [
"public",
"int",
"add",
"(",
"byte",
"[",
"]",
"value",
",",
"int",
"valueOffset",
",",
"int",
"valueLength",
")",
"{",
"grow",
"(",
"length",
"+",
"valueLength",
")",
";",
"data",
".",
"setBytes",
"(",
"length",
",",
"value",
",",
"valueOffset",
",",
... | Copy a slice of a byte array into our buffer.
@param value the array to copy from
@param valueOffset the first location to copy from value
@param valueLength the number of bytes to copy from value
@return the offset of the start of the value | [
"Copy",
"a",
"slice",
"of",
"a",
"byte",
"array",
"into",
"our",
"buffer",
"."
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/DynamicByteArray.java#L79-L85 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.setTime | public <T extends Model> T setTime(String attributeName, Object value) {
"""
Sets attribute value as <code>java.sql.Time</code>.
If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class
<code>java.sql.Time</code>, given the value is an instance of <code>S</cod... | java | public <T extends Model> T setTime(String attributeName, Object value) {
Converter<Object, Time> converter = modelRegistryLocal.converterForValue(
attributeName, value, Time.class);
return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toTime(value));
} | [
"public",
"<",
"T",
"extends",
"Model",
">",
"T",
"setTime",
"(",
"String",
"attributeName",
",",
"Object",
"value",
")",
"{",
"Converter",
"<",
"Object",
",",
"Time",
">",
"converter",
"=",
"modelRegistryLocal",
".",
"converterForValue",
"(",
"attributeName",... | Sets attribute value as <code>java.sql.Time</code>.
If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class
<code>java.sql.Time</code>, given the value is an instance of <code>S</code>, then it will be used,
otherwise performs a conversion using {@link Convert#toTim... | [
"Sets",
"attribute",
"value",
"as",
"<code",
">",
"java",
".",
"sql",
".",
"Time<",
"/",
"code",
">",
".",
"If",
"there",
"is",
"a",
"{",
"@link",
"Converter",
"}",
"registered",
"for",
"the",
"attribute",
"that",
"converts",
"from",
"Class",
"<code",
... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1801-L1805 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereoLinePt.java | HomographyInducedStereoLinePt.setFundamental | public void setFundamental( DMatrixRMaj F , Point3D_F64 e2 ) {
"""
Specify the fundamental matrix and the camera 2 epipole.
@param F Fundamental matrix.
@param e2 Epipole for camera 2. If null it will be computed internally.
"""
this.F = F;
if( e2 != null )
this.e2.set(e2);
else {
MultiViewOps... | java | public void setFundamental( DMatrixRMaj F , Point3D_F64 e2 ) {
this.F = F;
if( e2 != null )
this.e2.set(e2);
else {
MultiViewOps.extractEpipoles(F,new Point3D_F64(),this.e2);
}
} | [
"public",
"void",
"setFundamental",
"(",
"DMatrixRMaj",
"F",
",",
"Point3D_F64",
"e2",
")",
"{",
"this",
".",
"F",
"=",
"F",
";",
"if",
"(",
"e2",
"!=",
"null",
")",
"this",
".",
"e2",
".",
"set",
"(",
"e2",
")",
";",
"else",
"{",
"MultiViewOps",
... | Specify the fundamental matrix and the camera 2 epipole.
@param F Fundamental matrix.
@param e2 Epipole for camera 2. If null it will be computed internally. | [
"Specify",
"the",
"fundamental",
"matrix",
"and",
"the",
"camera",
"2",
"epipole",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereoLinePt.java#L79-L86 |
deeplearning4j/deeplearning4j | nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/transport/BaseTransport.java | BaseTransport.clientMessageHandler | protected void clientMessageHandler(DirectBuffer buffer, int offset, int length, Header header) {
"""
This message handler is responsible for receiving messages on Client side
@param buffer
@param offset
@param length
@param header
"""
/**
* All incoming messages here are supposed to be "... | java | protected void clientMessageHandler(DirectBuffer buffer, int offset, int length, Header header) {
/**
* All incoming messages here are supposed to be "just messages", only unicast communication
* All of them should implement MeaningfulMessage interface
*/
// TODO: to be impl... | [
"protected",
"void",
"clientMessageHandler",
"(",
"DirectBuffer",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
",",
"Header",
"header",
")",
"{",
"/**\n * All incoming messages here are supposed to be \"just messages\", only unicast communication\n * All ... | This message handler is responsible for receiving messages on Client side
@param buffer
@param offset
@param length
@param header | [
"This",
"message",
"handler",
"is",
"responsible",
"for",
"receiving",
"messages",
"on",
"Client",
"side"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-parameter-server-parent/nd4j-parameter-server-node/src/main/java/org/nd4j/parameterserver/distributed/transport/BaseTransport.java#L269-L282 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java | NetworkConfig.getOrderer | private Orderer getOrderer(HFClient client, String ordererName) throws InvalidArgumentException {
"""
Returns a new Orderer instance for the specified orderer name
"""
Orderer orderer = null;
Node o = orderers.get(ordererName);
if (o != null) {
orderer = client.newOrderer(o.... | java | private Orderer getOrderer(HFClient client, String ordererName) throws InvalidArgumentException {
Orderer orderer = null;
Node o = orderers.get(ordererName);
if (o != null) {
orderer = client.newOrderer(o.getName(), o.getUrl(), o.getProperties());
}
return orderer;
... | [
"private",
"Orderer",
"getOrderer",
"(",
"HFClient",
"client",
",",
"String",
"ordererName",
")",
"throws",
"InvalidArgumentException",
"{",
"Orderer",
"orderer",
"=",
"null",
";",
"Node",
"o",
"=",
"orderers",
".",
"get",
"(",
"ordererName",
")",
";",
"if",
... | Returns a new Orderer instance for the specified orderer name | [
"Returns",
"a",
"new",
"Orderer",
"instance",
"for",
"the",
"specified",
"orderer",
"name"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/NetworkConfig.java#L793-L800 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java | ParameterFormatter.formatMessage | static void formatMessage(final StringBuilder buffer, final String messagePattern,
final Object[] arguments, final int argCount) {
"""
Replace placeholders in the given messagePattern with arguments.
@param buffer the buffer to write the formatted message into
@param messagePattern the message patt... | java | static void formatMessage(final StringBuilder buffer, final String messagePattern,
final Object[] arguments, final int argCount) {
if (messagePattern == null || arguments == null || argCount == 0) {
buffer.append(messagePattern);
return;
}
int escapeCounter = ... | [
"static",
"void",
"formatMessage",
"(",
"final",
"StringBuilder",
"buffer",
",",
"final",
"String",
"messagePattern",
",",
"final",
"Object",
"[",
"]",
"arguments",
",",
"final",
"int",
"argCount",
")",
"{",
"if",
"(",
"messagePattern",
"==",
"null",
"||",
"... | Replace placeholders in the given messagePattern with arguments.
@param buffer the buffer to write the formatted message into
@param messagePattern the message pattern containing placeholders.
@param arguments the arguments to be used to replace placeholders. | [
"Replace",
"placeholders",
"in",
"the",
"given",
"messagePattern",
"with",
"arguments",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java#L226-L262 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/LongLiteralLowerCaseSuffix.java | LongLiteralLowerCaseSuffix.getLongLiteral | private static String getLongLiteral(LiteralTree literalTree, VisitorState state) {
"""
Extracts the long literal corresponding to a given {@link LiteralTree} node from the source
code as a string. Returns null if the source code is not available.
"""
JCLiteral longLiteral = (JCLiteral) literalTree;
C... | java | private static String getLongLiteral(LiteralTree literalTree, VisitorState state) {
JCLiteral longLiteral = (JCLiteral) literalTree;
CharSequence sourceFile = state.getSourceCode();
if (sourceFile == null) {
return null;
}
int start = longLiteral.getStartPosition();
java.util.regex.Matcher... | [
"private",
"static",
"String",
"getLongLiteral",
"(",
"LiteralTree",
"literalTree",
",",
"VisitorState",
"state",
")",
"{",
"JCLiteral",
"longLiteral",
"=",
"(",
"JCLiteral",
")",
"literalTree",
";",
"CharSequence",
"sourceFile",
"=",
"state",
".",
"getSourceCode",
... | Extracts the long literal corresponding to a given {@link LiteralTree} node from the source
code as a string. Returns null if the source code is not available. | [
"Extracts",
"the",
"long",
"literal",
"corresponding",
"to",
"a",
"given",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/LongLiteralLowerCaseSuffix.java#L71-L84 |
eurekaclinical/eurekaclinical-standard-apis | src/main/java/org/eurekaclinical/standardapis/dao/GenericDao.java | GenericDao.getUniqueByAttribute | protected <Y> T getUniqueByAttribute(String attributeName, Y value) {
"""
Gets the entity that has the target value of the specified attribute.
@param <Y> the type of the attribute and target value.
@param attributeName the name of the attribute.
@param value the target value of the given attribute.
@retur... | java | protected <Y> T getUniqueByAttribute(String attributeName, Y value) {
try {
return getDatabaseSupport().getUniqueByAttribute(getEntityClass(), attributeName, value);
} catch (NoResultException ex) {
return null;
}
} | [
"protected",
"<",
"Y",
">",
"T",
"getUniqueByAttribute",
"(",
"String",
"attributeName",
",",
"Y",
"value",
")",
"{",
"try",
"{",
"return",
"getDatabaseSupport",
"(",
")",
".",
"getUniqueByAttribute",
"(",
"getEntityClass",
"(",
")",
",",
"attributeName",
",",... | Gets the entity that has the target value of the specified attribute.
@param <Y> the type of the attribute and target value.
@param attributeName the name of the attribute.
@param value the target value of the given attribute.
@return the matching entity, or <code>null</code> if there is none. | [
"Gets",
"the",
"entity",
"that",
"has",
"the",
"target",
"value",
"of",
"the",
"specified",
"attribute",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-standard-apis/blob/690036dde82a4f2c2106d32403cdf1c713429377/src/main/java/org/eurekaclinical/standardapis/dao/GenericDao.java#L237-L243 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObject.java | JsiiObject.jsiiStaticCall | @Nullable
protected static <T> T jsiiStaticCall(final Class<?> nativeClass, final String method, final Class<T> returnType, @Nullable final Object... args) {
"""
Calls a static method.
@param nativeClass The java class.
@param method The method to call.
@param returnType The return type.
@param args The me... | java | @Nullable
protected static <T> T jsiiStaticCall(final Class<?> nativeClass, final String method, final Class<T> returnType, @Nullable final Object... args) {
String fqn = engine.loadModuleForClass(nativeClass);
return JsiiObjectMapper.treeToValue(engine.getClient()
... | [
"@",
"Nullable",
"protected",
"static",
"<",
"T",
">",
"T",
"jsiiStaticCall",
"(",
"final",
"Class",
"<",
"?",
">",
"nativeClass",
",",
"final",
"String",
"method",
",",
"final",
"Class",
"<",
"T",
">",
"returnType",
",",
"@",
"Nullable",
"final",
"Objec... | Calls a static method.
@param nativeClass The java class.
@param method The method to call.
@param returnType The return type.
@param args The method arguments.
@param <T> Return type.
@return Return value. | [
"Calls",
"a",
"static",
"method",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiObject.java#L72-L78 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.listVnets | public List<VnetInfoInner> listVnets(String resourceGroupName, String name) {
"""
Get all Virtual Networks associated with an App Service plan.
Get all Virtual Networks associated with an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of t... | java | public List<VnetInfoInner> listVnets(String resourceGroupName, String name) {
return listVnetsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body();
} | [
"public",
"List",
"<",
"VnetInfoInner",
">",
"listVnets",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"listVnetsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
... | Get all Virtual Networks associated with an App Service plan.
Get all Virtual Networks associated with an App Service plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@throws IllegalArgumentException thrown if parameters fail the validat... | [
"Get",
"all",
"Virtual",
"Networks",
"associated",
"with",
"an",
"App",
"Service",
"plan",
".",
"Get",
"all",
"Virtual",
"Networks",
"associated",
"with",
"an",
"App",
"Service",
"plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L2984-L2986 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/MatchConditionOnElements.java | MatchConditionOnElements.removeMatch | public void removeMatch(String name, PseudoClassType pseudoClass) {
"""
Removes the pseudo class from the given element name. Element names are case-insensitive.
@param name the element name
@param pseudoClass the pseudo class to be removed
"""
if (names != null)
{
Set<PseudoClass... | java | public void removeMatch(String name, PseudoClassType pseudoClass)
{
if (names != null)
{
Set<PseudoClassType> classes = names.get(name);
if (classes != null)
classes.remove(pseudoClass);
}
} | [
"public",
"void",
"removeMatch",
"(",
"String",
"name",
",",
"PseudoClassType",
"pseudoClass",
")",
"{",
"if",
"(",
"names",
"!=",
"null",
")",
"{",
"Set",
"<",
"PseudoClassType",
">",
"classes",
"=",
"names",
".",
"get",
"(",
"name",
")",
";",
"if",
"... | Removes the pseudo class from the given element name. Element names are case-insensitive.
@param name the element name
@param pseudoClass the pseudo class to be removed | [
"Removes",
"the",
"pseudo",
"class",
"from",
"the",
"given",
"element",
"name",
".",
"Element",
"names",
"are",
"case",
"-",
"insensitive",
"."
] | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/MatchConditionOnElements.java#L121-L129 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/FeatureInfoBuilder.java | FeatureInfoBuilder.projectGeometry | public void projectGeometry(GeoPackageGeometryData geometryData, Projection projection) {
"""
Project the geometry into the provided projection
@param geometryData geometry data
@param projection projection
"""
if (geometryData.getGeometry() != null) {
try {
SpatialR... | java | public void projectGeometry(GeoPackageGeometryData geometryData, Projection projection) {
if (geometryData.getGeometry() != null) {
try {
SpatialReferenceSystemDao srsDao = DaoManager.createDao(featureDao.getDb().getConnectionSource(), SpatialReferenceSystem.class);
... | [
"public",
"void",
"projectGeometry",
"(",
"GeoPackageGeometryData",
"geometryData",
",",
"Projection",
"projection",
")",
"{",
"if",
"(",
"geometryData",
".",
"getGeometry",
"(",
")",
"!=",
"null",
")",
"{",
"try",
"{",
"SpatialReferenceSystemDao",
"srsDao",
"=",
... | Project the geometry into the provided projection
@param geometryData geometry data
@param projection projection | [
"Project",
"the",
"geometry",
"into",
"the",
"provided",
"projection"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/FeatureInfoBuilder.java#L528-L553 |
whizzosoftware/WZWave | src/main/java/com/whizzosoftware/wzwave/channel/TransactionInboundHandler.java | TransactionInboundHandler.channelRead | @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
"""
Called when data is read from the Z-Wave network.
@param ctx the handler context
@param msg the message that was read
"""
if (msg instanceof Frame) {
Frame frame = (Frame) msg;
if (hasCurrentT... | java | @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
if (msg instanceof Frame) {
Frame frame = (Frame) msg;
if (hasCurrentTransaction()) {
String tid = currentDataFrameTransaction.getId();
logger.trace("Received frame within trans... | [
"@",
"Override",
"public",
"void",
"channelRead",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"msg",
")",
"{",
"if",
"(",
"msg",
"instanceof",
"Frame",
")",
"{",
"Frame",
"frame",
"=",
"(",
"Frame",
")",
"msg",
";",
"if",
"(",
"hasCurrentTransactio... | Called when data is read from the Z-Wave network.
@param ctx the handler context
@param msg the message that was read | [
"Called",
"when",
"data",
"is",
"read",
"from",
"the",
"Z",
"-",
"Wave",
"network",
"."
] | train | https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/channel/TransactionInboundHandler.java#L50-L82 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java | ProcessContextProperties.getDataUsageNameIndexes | private Set<Integer> getDataUsageNameIndexes() throws PropertyException {
"""
Returns all used indexes for data usage property names.<br>
Constraint names are enumerated (DATA_USAGE_1, DATA_USAGE_2, ...).<br>
When new data usages are added, the lowest unused index is used within
the new property name.
@retur... | java | private Set<Integer> getDataUsageNameIndexes() throws PropertyException {
Set<Integer> result = new HashSet<>();
Set<String> dataUsageNames = getDataUsageNameList();
if (dataUsageNames.isEmpty()) {
return result;
}
for (String dataUsageName : dataUsageNames) {
... | [
"private",
"Set",
"<",
"Integer",
">",
"getDataUsageNameIndexes",
"(",
")",
"throws",
"PropertyException",
"{",
"Set",
"<",
"Integer",
">",
"result",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"Set",
"<",
"String",
">",
"dataUsageNames",
"=",
"getDataUsageN... | Returns all used indexes for data usage property names.<br>
Constraint names are enumerated (DATA_USAGE_1, DATA_USAGE_2, ...).<br>
When new data usages are added, the lowest unused index is used within
the new property name.
@return The set of indexes in use.
@throws PropertyException if existing constraint names are ... | [
"Returns",
"all",
"used",
"indexes",
"for",
"data",
"usage",
"property",
"names",
".",
"<br",
">",
"Constraint",
"names",
"are",
"enumerated",
"(",
"DATA_USAGE_1",
"DATA_USAGE_2",
"...",
")",
".",
"<br",
">",
"When",
"new",
"data",
"usages",
"are",
"added",
... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java#L234-L254 |
Azure/azure-sdk-for-java | locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java | ManagementLocksInner.deleteAtResourceGroupLevelAsync | public Observable<Void> deleteAtResourceGroupLevelAsync(String resourceGroupName, String lockName) {
"""
Deletes a management lock at the resource group level.
To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owne... | java | public Observable<Void> deleteAtResourceGroupLevelAsync(String resourceGroupName, String lockName) {
return deleteAtResourceGroupLevelWithServiceResponseAsync(resourceGroupName, lockName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> resp... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteAtResourceGroupLevelAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"lockName",
")",
"{",
"return",
"deleteAtResourceGroupLevelWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"lockName",
")",
".",
"map"... | Deletes a management lock at the resource group level.
To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Access Administrator are granted those actions.
@param resourceGroupName The name of the resource g... | [
"Deletes",
"a",
"management",
"lock",
"at",
"the",
"resource",
"group",
"level",
".",
"To",
"delete",
"management",
"locks",
"you",
"must",
"have",
"access",
"to",
"Microsoft",
".",
"Authorization",
"/",
"*",
"or",
"Microsoft",
".",
"Authorization",
"/",
"lo... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L276-L283 |
alkacon/opencms-core | src/org/opencms/gwt/CmsGwtActionElement.java | CmsGwtActionElement.exportDictionary | public static String exportDictionary(String name, String data) {
"""
Exports a dictionary by the given name as the content attribute of a meta tag.<p>
@param name the dictionary name
@param data the data
@return the meta tag
"""
StringBuffer sb = new StringBuffer();
sb.append("<meta na... | java | public static String exportDictionary(String name, String data) {
StringBuffer sb = new StringBuffer();
sb.append("<meta name=\"").append(name).append("\" content=\"").append(data).append("\" />");
return sb.toString();
} | [
"public",
"static",
"String",
"exportDictionary",
"(",
"String",
"name",
",",
"String",
"data",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"<meta name=\\\"\"",
")",
".",
"append",
"(",
"name",
")"... | Exports a dictionary by the given name as the content attribute of a meta tag.<p>
@param name the dictionary name
@param data the data
@return the meta tag | [
"Exports",
"a",
"dictionary",
"by",
"the",
"given",
"name",
"as",
"the",
"content",
"attribute",
"of",
"a",
"meta",
"tag",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsGwtActionElement.java#L193-L198 |
h2oai/h2o-2 | src/main/java/hex/deeplearning/DeepLearning.java | DeepLearning.updateFrame | Frame updateFrame(Frame target, Frame src) {
"""
Helper to update a Frame and adding it to the local trash at the same time
@param target Frame referece, to be overwritten
@param src Newly made frame, to be deleted via local trash
@return src
"""
if (src != target) ltrash(src);
return src;
} | java | Frame updateFrame(Frame target, Frame src) {
if (src != target) ltrash(src);
return src;
} | [
"Frame",
"updateFrame",
"(",
"Frame",
"target",
",",
"Frame",
"src",
")",
"{",
"if",
"(",
"src",
"!=",
"target",
")",
"ltrash",
"(",
"src",
")",
";",
"return",
"src",
";",
"}"
] | Helper to update a Frame and adding it to the local trash at the same time
@param target Frame referece, to be overwritten
@param src Newly made frame, to be deleted via local trash
@return src | [
"Helper",
"to",
"update",
"a",
"Frame",
"and",
"adding",
"it",
"to",
"the",
"local",
"trash",
"at",
"the",
"same",
"time"
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearning.java#L1020-L1023 |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/Utils4J.java | Utils4J.createCipher | private static Cipher createCipher(final String algorithm, final int mode, final char[] password, final byte[] salt, final int count)
throws GeneralSecurityException {
"""
Creates a cipher for encryption or decryption.
@param algorithm
PBE algorithm like "PBEWithMD5AndDES" or "PBEWithMD5AndTripleD... | java | private static Cipher createCipher(final String algorithm, final int mode, final char[] password, final byte[] salt, final int count)
throws GeneralSecurityException {
final SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(algorithm);
final PBEKeySpec keySpec = new PBEKeySpec(... | [
"private",
"static",
"Cipher",
"createCipher",
"(",
"final",
"String",
"algorithm",
",",
"final",
"int",
"mode",
",",
"final",
"char",
"[",
"]",
"password",
",",
"final",
"byte",
"[",
"]",
"salt",
",",
"final",
"int",
"count",
")",
"throws",
"GeneralSecuri... | Creates a cipher for encryption or decryption.
@param algorithm
PBE algorithm like "PBEWithMD5AndDES" or "PBEWithMD5AndTripleDES".
@param mode
Encyrption or decyrption.
@param password
Password.
@param salt
Salt usable with algorithm.
@param count
Iterations.
@return Ready initialized cipher.
@throws GeneralSecurity... | [
"Creates",
"a",
"cipher",
"for",
"encryption",
"or",
"decryption",
"."
] | train | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/Utils4J.java#L383-L394 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/geometry/LinearRing.java | LinearRing.getCentroid | public Coordinate getCentroid() {
"""
The centroid is also known as the "center of gravity" or the "center of mass".
@return Return the center point.
"""
if (isEmpty()) {
return null;
}
double area = getSignedArea();
double x = 0;
double y = 0;
Coordinate[] coordinates = getCoordinates();
f... | java | public Coordinate getCentroid() {
if (isEmpty()) {
return null;
}
double area = getSignedArea();
double x = 0;
double y = 0;
Coordinate[] coordinates = getCoordinates();
for (int i = 1; i < coordinates.length; i++) {
double x1 = coordinates[i - 1].getX();
double y1 = coordinates[i - 1].getY();
... | [
"public",
"Coordinate",
"getCentroid",
"(",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"double",
"area",
"=",
"getSignedArea",
"(",
")",
";",
"double",
"x",
"=",
"0",
";",
"double",
"y",
"=",
"0",
";",
"Coordina... | The centroid is also known as the "center of gravity" or the "center of mass".
@return Return the center point. | [
"The",
"centroid",
"is",
"also",
"known",
"as",
"the",
"center",
"of",
"gravity",
"or",
"the",
"center",
"of",
"mass",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/geometry/LinearRing.java#L107-L126 |
knowm/XChange | xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseMarketDataServiceRaw.java | CoinbaseMarketDataServiceRaw.getCoinbaseSellPrice | public CoinbasePrice getCoinbaseSellPrice(Currency base, Currency counter) throws IOException {
"""
Unauthenticated resource that tells you the amount you can get if you sell one unit.
@param pair The currency pair.
@return The price in the desired {@code currency} to sell one unit.
@throws IOException
@see ... | java | public CoinbasePrice getCoinbaseSellPrice(Currency base, Currency counter) throws IOException {
return coinbase.getSellPrice(Coinbase.CB_VERSION_VALUE, base + "-" + counter).getData();
} | [
"public",
"CoinbasePrice",
"getCoinbaseSellPrice",
"(",
"Currency",
"base",
",",
"Currency",
"counter",
")",
"throws",
"IOException",
"{",
"return",
"coinbase",
".",
"getSellPrice",
"(",
"Coinbase",
".",
"CB_VERSION_VALUE",
",",
"base",
"+",
"\"-\"",
"+",
"counter... | Unauthenticated resource that tells you the amount you can get if you sell one unit.
@param pair The currency pair.
@return The price in the desired {@code currency} to sell one unit.
@throws IOException
@see <a
href="https://developers.coinbase.com/api/v2#get-sell-price">developers.coinbase.com/api/v2#get-sell-price<... | [
"Unauthenticated",
"resource",
"that",
"tells",
"you",
"the",
"amount",
"you",
"can",
"get",
"if",
"you",
"sell",
"one",
"unit",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseMarketDataServiceRaw.java#L58-L61 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/profile/BasicUserProfile.java | BasicUserProfile.getAuthenticationAttribute | public <T> T getAuthenticationAttribute(final String name, final Class<T> clazz) {
"""
Return authentication attribute with name
@param name Name of authentication attribute
@param clazz The class of the authentication attribute
@param <T> The type of the authentication attribute
@return the named attribute
... | java | public <T> T getAuthenticationAttribute(final String name, final Class<T> clazz)
{
final Object attribute = getAuthenticationAttribute(name);
return getAttributeByType(name, clazz, attribute);
} | [
"public",
"<",
"T",
">",
"T",
"getAuthenticationAttribute",
"(",
"final",
"String",
"name",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"final",
"Object",
"attribute",
"=",
"getAuthenticationAttribute",
"(",
"name",
")",
";",
"return",
"getAttri... | Return authentication attribute with name
@param name Name of authentication attribute
@param clazz The class of the authentication attribute
@param <T> The type of the authentication attribute
@return the named attribute | [
"Return",
"authentication",
"attribute",
"with",
"name"
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/profile/BasicUserProfile.java#L309-L313 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getContinentInfo | public void getContinentInfo(int[] ids, Callback<List<Continent>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@... | java | public void getContinentInfo(int[] ids, Callback<List<Continent>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getContinentInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getContinentInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Continent",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"i... | For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of continents id
@param callback callback... | [
"For",
"more",
"info",
"on",
"continents",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"continents",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"use... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1032-L1035 |
menacher/java-game-server | jetserver/src/main/java/org/menacheri/jetserver/concurrent/Fibers.java | Fibers.pooledFiber | public static Fiber pooledFiber(Lane<String,ExecutorService> lane) {
"""
Creates and starts a fiber and returns the created instance.
@return The created fiber.
"""
if(null == lanePoolFactoryMap.get(lane))
{
lanePoolFactoryMap.putIfAbsent(lane, new PoolFiberFactory(lane.getUnderlyingLane()));
}
... | java | public static Fiber pooledFiber(Lane<String,ExecutorService> lane)
{
if(null == lanePoolFactoryMap.get(lane))
{
lanePoolFactoryMap.putIfAbsent(lane, new PoolFiberFactory(lane.getUnderlyingLane()));
}
Fiber fiber = lanePoolFactoryMap.get(lane).create();
fiber.start();
return fiber;
} | [
"public",
"static",
"Fiber",
"pooledFiber",
"(",
"Lane",
"<",
"String",
",",
"ExecutorService",
">",
"lane",
")",
"{",
"if",
"(",
"null",
"==",
"lanePoolFactoryMap",
".",
"get",
"(",
"lane",
")",
")",
"{",
"lanePoolFactoryMap",
".",
"putIfAbsent",
"(",
"la... | Creates and starts a fiber and returns the created instance.
@return The created fiber. | [
"Creates",
"and",
"starts",
"a",
"fiber",
"and",
"returns",
"the",
"created",
"instance",
"."
] | train | https://github.com/menacher/java-game-server/blob/668ca49e8bd1dac43add62378cf6c22a93125d48/jetserver/src/main/java/org/menacheri/jetserver/concurrent/Fibers.java#L52-L62 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java | EncodingGroovyMethods.encodeBase64Url | public static Writable encodeBase64Url(Byte[] data, boolean pad) {
"""
Produce a Writable object which writes the Base64 URL and Filename Safe encoding of the byte array.
Calling toString() on the result returns the encoding as a String. For more
information on Base64 URL and Filename Safe encoding see <code>RFC... | java | public static Writable encodeBase64Url(Byte[] data, boolean pad) {
return encodeBase64Url(DefaultTypeTransformation.convertToByteArray(data), pad);
} | [
"public",
"static",
"Writable",
"encodeBase64Url",
"(",
"Byte",
"[",
"]",
"data",
",",
"boolean",
"pad",
")",
"{",
"return",
"encodeBase64Url",
"(",
"DefaultTypeTransformation",
".",
"convertToByteArray",
"(",
"data",
")",
",",
"pad",
")",
";",
"}"
] | Produce a Writable object which writes the Base64 URL and Filename Safe encoding of the byte array.
Calling toString() on the result returns the encoding as a String. For more
information on Base64 URL and Filename Safe encoding see <code>RFC 4648 - Section 5
Base 64 Encoding with URL and Filename Safe Alphabet</code>.... | [
"Produce",
"a",
"Writable",
"object",
"which",
"writes",
"the",
"Base64",
"URL",
"and",
"Filename",
"Safe",
"encoding",
"of",
"the",
"byte",
"array",
".",
"Calling",
"toString",
"()",
"on",
"the",
"result",
"returns",
"the",
"encoding",
"as",
"a",
"String",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java#L193-L195 |
jamesdbloom/mockserver | mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java | HttpRequest.withQueryStringParameters | public HttpRequest withQueryStringParameters(Map<String, List<String>> parameters) {
"""
The query string parameters to match on as a Map<String, List<String>> where the values or keys of each parameter can be either a string or a regex
(for more details of the supported regex syntax see http://docs.oracle.com/ja... | java | public HttpRequest withQueryStringParameters(Map<String, List<String>> parameters) {
this.queryStringParameters.withEntries(parameters);
return this;
} | [
"public",
"HttpRequest",
"withQueryStringParameters",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"parameters",
")",
"{",
"this",
".",
"queryStringParameters",
".",
"withEntries",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | The query string parameters to match on as a Map<String, List<String>> where the values or keys of each parameter can be either a string or a regex
(for more details of the supported regex syntax see http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html)
@param parameters the Map<String, List<String>> ... | [
"The",
"query",
"string",
"parameters",
"to",
"match",
"on",
"as",
"a",
"Map<String",
"List<String",
">>",
"where",
"the",
"values",
"or",
"keys",
"of",
"each",
"parameter",
"can",
"be",
"either",
"a",
"string",
"or",
"a",
"regex",
"(",
"for",
"more",
"d... | train | https://github.com/jamesdbloom/mockserver/blob/8b84fdd877e57b4eb780c9f8c8b1d65bcb448025/mockserver-core/src/main/java/org/mockserver/model/HttpRequest.java#L175-L178 |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.warnVisible | protected void warnVisible (SceneBlock block, Rectangle sbounds) {
"""
Issues a warning to the error log that the specified block became visible prior to being
resolved. Derived classes may wish to augment or inhibit this warning.
"""
log.warning("Block visible during resolution " + block +
... | java | protected void warnVisible (SceneBlock block, Rectangle sbounds)
{
log.warning("Block visible during resolution " + block +
" sbounds:" + StringUtil.toString(sbounds) +
" vbounds:" + StringUtil.toString(_vbounds) + ".");
} | [
"protected",
"void",
"warnVisible",
"(",
"SceneBlock",
"block",
",",
"Rectangle",
"sbounds",
")",
"{",
"log",
".",
"warning",
"(",
"\"Block visible during resolution \"",
"+",
"block",
"+",
"\" sbounds:\"",
"+",
"StringUtil",
".",
"toString",
"(",
"sbounds",
")",
... | Issues a warning to the error log that the specified block became visible prior to being
resolved. Derived classes may wish to augment or inhibit this warning. | [
"Issues",
"a",
"warning",
"to",
"the",
"error",
"log",
"that",
"the",
"specified",
"block",
"became",
"visible",
"prior",
"to",
"being",
"resolved",
".",
"Derived",
"classes",
"may",
"wish",
"to",
"augment",
"or",
"inhibit",
"this",
"warning",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L967-L972 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.joining | public String joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix) {
"""
Returns a {@link String} which is the concatenation of the results
of calling {@link String#valueOf(Object)} on each element of this stream,
separated by the specified delimiter, with the specified prefix and
suffix in... | java | public String joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix) {
return map(String::valueOf).rawCollect(Collectors.joining(delimiter, prefix, suffix));
} | [
"public",
"String",
"joining",
"(",
"CharSequence",
"delimiter",
",",
"CharSequence",
"prefix",
",",
"CharSequence",
"suffix",
")",
"{",
"return",
"map",
"(",
"String",
"::",
"valueOf",
")",
".",
"rawCollect",
"(",
"Collectors",
".",
"joining",
"(",
"delimiter... | Returns a {@link String} which is the concatenation of the results
of calling {@link String#valueOf(Object)} on each element of this stream,
separated by the specified delimiter, with the specified prefix and
suffix in encounter order.
<p>
This is a <a href="package-summary.html#StreamOps">terminal</a>
operation.
@pa... | [
"Returns",
"a",
"{",
"@link",
"String",
"}",
"which",
"is",
"the",
"concatenation",
"of",
"the",
"results",
"of",
"calling",
"{",
"@link",
"String#valueOf",
"(",
"Object",
")",
"}",
"on",
"each",
"element",
"of",
"this",
"stream",
"separated",
"by",
"the",... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L786-L788 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/webapp/views/LicenseListView.java | LicenseListView.getTable | public Table getTable() {
"""
Generate a table that contains the dependencies information with the column that match the configured filters
@return Table
"""
final Table table = new Table("Name", "Long Name", "URL", "Comment");
// Create row(s) per dependency
for(final License licen... | java | public Table getTable(){
final Table table = new Table("Name", "Long Name", "URL", "Comment");
// Create row(s) per dependency
for(final License license: licenses){
table.addRow(license.getName(), license.getLongName(), license.getUrl(), license.getComments());
}
re... | [
"public",
"Table",
"getTable",
"(",
")",
"{",
"final",
"Table",
"table",
"=",
"new",
"Table",
"(",
"\"Name\"",
",",
"\"Long Name\"",
",",
"\"URL\"",
",",
"\"Comment\"",
")",
";",
"// Create row(s) per dependency",
"for",
"(",
"final",
"License",
"license",
":"... | Generate a table that contains the dependencies information with the column that match the configured filters
@return Table | [
"Generate",
"a",
"table",
"that",
"contains",
"the",
"dependencies",
"information",
"with",
"the",
"column",
"that",
"match",
"the",
"configured",
"filters"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/views/LicenseListView.java#L58-L67 |
davetcc/tcMenu | tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/domain/TextMenuItem.java | TextMenuItem.newMenuState | @Override
public MenuState<String> newMenuState(String value, boolean changed, boolean active) {
"""
Returns a new String current value that can be used as the current value in the Menutree
@param value the new value
@param changed if the value has changed
@param active if the value is active.
@return the ... | java | @Override
public MenuState<String> newMenuState(String value, boolean changed, boolean active) {
return new StringMenuState(changed, active, value);
} | [
"@",
"Override",
"public",
"MenuState",
"<",
"String",
">",
"newMenuState",
"(",
"String",
"value",
",",
"boolean",
"changed",
",",
"boolean",
"active",
")",
"{",
"return",
"new",
"StringMenuState",
"(",
"changed",
",",
"active",
",",
"value",
")",
";",
"}... | Returns a new String current value that can be used as the current value in the Menutree
@param value the new value
@param changed if the value has changed
@param active if the value is active.
@return the new menu state object | [
"Returns",
"a",
"new",
"String",
"current",
"value",
"that",
"can",
"be",
"used",
"as",
"the",
"current",
"value",
"in",
"the",
"Menutree"
] | train | https://github.com/davetcc/tcMenu/blob/61546e4b982b25ceaff384073fe9ec1fff55e64a/tcMenuJavaApi/src/main/java/com/thecoderscorner/menu/domain/TextMenuItem.java#L47-L50 |
samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.listToString | public static String listToString (Object val, Formatter formatter) {
"""
Formats a collection of elements (either an array of objects, an {@link Iterator}, an {@link
Iterable} or an {@link Enumeration}) using the supplied formatter on each element. Note
that if you simply wish to format a collection of elements... | java | public static String listToString (Object val, Formatter formatter)
{
StringBuilder buf = new StringBuilder();
listToString(buf, val, formatter);
return buf.toString();
} | [
"public",
"static",
"String",
"listToString",
"(",
"Object",
"val",
",",
"Formatter",
"formatter",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"listToString",
"(",
"buf",
",",
"val",
",",
"formatter",
")",
";",
"return",
"... | Formats a collection of elements (either an array of objects, an {@link Iterator}, an {@link
Iterable} or an {@link Enumeration}) using the supplied formatter on each element. Note
that if you simply wish to format a collection of elements by calling {@link
Object#toString} on each element, you can just pass the list t... | [
"Formats",
"a",
"collection",
"of",
"elements",
"(",
"either",
"an",
"array",
"of",
"objects",
"an",
"{"
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L450-L455 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxRetentionPolicyAssignment.java | BoxRetentionPolicyAssignment.createAssignmentToFolder | public static BoxRetentionPolicyAssignment.Info createAssignmentToFolder(BoxAPIConnection api, String policyID,
String folderID) {
"""
Assigns retention policy with givenID to the folder.
@param api the API connection to be used by the ... | java | public static BoxRetentionPolicyAssignment.Info createAssignmentToFolder(BoxAPIConnection api, String policyID,
String folderID) {
return createAssignment(api, policyID, new JsonObject().add("type", TYPE_FOLDER).add("id", folderID), ... | [
"public",
"static",
"BoxRetentionPolicyAssignment",
".",
"Info",
"createAssignmentToFolder",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"policyID",
",",
"String",
"folderID",
")",
"{",
"return",
"createAssignment",
"(",
"api",
",",
"policyID",
",",
"new",
"JsonO... | Assigns retention policy with givenID to the folder.
@param api the API connection to be used by the created assignment.
@param policyID id of the assigned retention policy.
@param folderID id of the folder to assign policy to.
@return info about created assignment. | [
"Assigns",
"retention",
"policy",
"with",
"givenID",
"to",
"the",
"folder",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxRetentionPolicyAssignment.java#L77-L80 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_house.java | Scs_house.cs_house | public static float cs_house(float[] x, int x_offset, float[] beta, int n) {
"""
Compute a Householder reflection, overwrite x with v, where
(I-beta*v*v')*x = s*e1. See Algo 5.1f.1f, Golub & Van Loan, 3rd ed.
@param x
x on output, v on input
@param x_offset
the index of the first element in array x
@param ... | java | public static float cs_house(float[] x, int x_offset, float[] beta, int n) {
float s, sigma = 0;
int i;
if (x == null || beta == null)
return (-1); /* check inputs */
for (i = 1; i < n; i++)
sigma += x[x_offset + i] * x[x_offset + i];
if (sigma == 0... | [
"public",
"static",
"float",
"cs_house",
"(",
"float",
"[",
"]",
"x",
",",
"int",
"x_offset",
",",
"float",
"[",
"]",
"beta",
",",
"int",
"n",
")",
"{",
"float",
"s",
",",
"sigma",
"=",
"0",
";",
"int",
"i",
";",
"if",
"(",
"x",
"==",
"null",
... | Compute a Householder reflection, overwrite x with v, where
(I-beta*v*v')*x = s*e1. See Algo 5.1f.1f, Golub & Van Loan, 3rd ed.
@param x
x on output, v on input
@param x_offset
the index of the first element in array x
@param beta
scalar beta
@param n
the length of x
@return norm2(x), -1 on error | [
"Compute",
"a",
"Householder",
"reflection",
"overwrite",
"x",
"with",
"v",
"where",
"(",
"I",
"-",
"beta",
"*",
"v",
"*",
"v",
")",
"*",
"x",
"=",
"s",
"*",
"e1",
".",
"See",
"Algo",
"5",
".",
"1f",
".",
"1f",
"Golub",
"&",
"Van",
"Loan",
"3rd... | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_house.java#L49-L66 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java | Levenshtein.weightedLevenshtein | public static <T extends Levenshtein> T weightedLevenshtein(String baseTarget, CharacterSubstitution characterSubstitution) {
"""
Returns a new Weighted Levenshtein edit distance instance
@see WeightedLevenshtein
@param baseTarget
@param characterSubstitution
@return
"""
return weightedLevenshtein(base... | java | public static <T extends Levenshtein> T weightedLevenshtein(String baseTarget, CharacterSubstitution characterSubstitution) {
return weightedLevenshtein(baseTarget, null, characterSubstitution);
} | [
"public",
"static",
"<",
"T",
"extends",
"Levenshtein",
">",
"T",
"weightedLevenshtein",
"(",
"String",
"baseTarget",
",",
"CharacterSubstitution",
"characterSubstitution",
")",
"{",
"return",
"weightedLevenshtein",
"(",
"baseTarget",
",",
"null",
",",
"characterSubst... | Returns a new Weighted Levenshtein edit distance instance
@see WeightedLevenshtein
@param baseTarget
@param characterSubstitution
@return | [
"Returns",
"a",
"new",
"Weighted",
"Levenshtein",
"edit",
"distance",
"instance"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java#L74-L76 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/ArrayUtil.java | ArrayUtil.endsWith | public static int endsWith(String str, String[] arr) {
"""
check if there is an element that ends with the specified string
@param str
@return int
"""
if ( arr == null ) {
return -1;
}
for ( int i = 0; i < arr.length; i++ ) {
if ( arr[i].endsWith(... | java | public static int endsWith(String str, String[] arr)
{
if ( arr == null ) {
return -1;
}
for ( int i = 0; i < arr.length; i++ ) {
if ( arr[i].endsWith(str) ) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"endsWith",
"(",
"String",
"str",
",",
"String",
"[",
"]",
"arr",
")",
"{",
"if",
"(",
"arr",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arr",
".",
"lengt... | check if there is an element that ends with the specified string
@param str
@return int | [
"check",
"if",
"there",
"is",
"an",
"element",
"that",
"ends",
"with",
"the",
"specified",
"string"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/ArrayUtil.java#L84-L97 |
paypal/SeLion | server/src/main/java/com/paypal/selion/pojos/BrowserInformationCache.java | BrowserInformationCache.updateBrowserInfo | public synchronized void updateBrowserInfo(URL url, String browserName, int maxInstances) {
"""
Updates the Cache for the provide Node represented by the {@link URL} instance. This methods creates or updates
information for the Node/Browser combination.
@param url
{@link URL} of the Node.
@param browserName
... | java | public synchronized void updateBrowserInfo(URL url, String browserName, int maxInstances) {
logger.entering(new Object[] { url, browserName, maxInstances });
BrowserInformation browserInformation = BrowserInformation.createBrowserInfo(browserName, maxInstances);
TestSlotInformation testSlotInfor... | [
"public",
"synchronized",
"void",
"updateBrowserInfo",
"(",
"URL",
"url",
",",
"String",
"browserName",
",",
"int",
"maxInstances",
")",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"url",
",",
"browserName",
",",
"maxInstances",
"}",... | Updates the Cache for the provide Node represented by the {@link URL} instance. This methods creates or updates
information for the Node/Browser combination.
@param url
{@link URL} of the Node.
@param browserName
Browser name as {@link String}.
@param maxInstances
Maximum instances of the browser. | [
"Updates",
"the",
"Cache",
"for",
"the",
"provide",
"Node",
"represented",
"by",
"the",
"{",
"@link",
"URL",
"}",
"instance",
".",
"This",
"methods",
"creates",
"or",
"updates",
"information",
"for",
"the",
"Node",
"/",
"Browser",
"combination",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/pojos/BrowserInformationCache.java#L89-L101 |
baratine/baratine | framework/src/main/java/com/caucho/v5/reflect/ReflectUtil.java | ReflectUtil.findDeclaredMethod | public static Method findDeclaredMethod(Class<?> cl, Method testMethod) {
"""
Finds any method matching the method name and parameter types.
"""
if (cl == null)
return null;
for (Method method : cl.getDeclaredMethods()) {
if (isMatch(method, testMethod))
return method;
}
... | java | public static Method findDeclaredMethod(Class<?> cl, Method testMethod)
{
if (cl == null)
return null;
for (Method method : cl.getDeclaredMethods()) {
if (isMatch(method, testMethod))
return method;
}
return null;
} | [
"public",
"static",
"Method",
"findDeclaredMethod",
"(",
"Class",
"<",
"?",
">",
"cl",
",",
"Method",
"testMethod",
")",
"{",
"if",
"(",
"cl",
"==",
"null",
")",
"return",
"null",
";",
"for",
"(",
"Method",
"method",
":",
"cl",
".",
"getDeclaredMethods",... | Finds any method matching the method name and parameter types. | [
"Finds",
"any",
"method",
"matching",
"the",
"method",
"name",
"and",
"parameter",
"types",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/reflect/ReflectUtil.java#L54-L65 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/dep/ProjectiveDependencyParser.java | ProjectiveDependencyParser.parseMultiRoot | public static double parseMultiRoot(double[] fracRoot, double[][] fracChild,
int[] parents) {
"""
Computes the maximum projective vine-parse tree with multiple root nodes
using the algorithm of (Eisner, 2000). In the resulting tree, the root
node will be the wall node (denoted by index -1), and may h... | java | public static double parseMultiRoot(double[] fracRoot, double[][] fracChild,
int[] parents) {
assert (parents.length == fracRoot.length);
assert (fracChild.length == fracRoot.length);
final int n = parents.length;
final ProjTreeChart c = new ProjTreeChart(n+1, DepParseTy... | [
"public",
"static",
"double",
"parseMultiRoot",
"(",
"double",
"[",
"]",
"fracRoot",
",",
"double",
"[",
"]",
"[",
"]",
"fracChild",
",",
"int",
"[",
"]",
"parents",
")",
"{",
"assert",
"(",
"parents",
".",
"length",
"==",
"fracRoot",
".",
"length",
")... | Computes the maximum projective vine-parse tree with multiple root nodes
using the algorithm of (Eisner, 2000). In the resulting tree, the root
node will be the wall node (denoted by index -1), and may have multiple
children.
@param fracRoot Input: The edge weights from the wall to each child.
@param fracChild Input: ... | [
"Computes",
"the",
"maximum",
"projective",
"vine",
"-",
"parse",
"tree",
"with",
"multiple",
"root",
"nodes",
"using",
"the",
"algorithm",
"of",
"(",
"Eisner",
"2000",
")",
".",
"In",
"the",
"resulting",
"tree",
"the",
"root",
"node",
"will",
"be",
"the",... | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/dep/ProjectiveDependencyParser.java#L90-L104 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.